赞
踩
.html
- <!DOCTYPE html>
- <html>
-
- <head>
- <meta charset="utf-8">
- <title>Hello World</title>
- <link rel="stylesheet" href="step1/CSS/style.css">
- </head>
-
- <body>
- <h1>CSS让网页样式更丰富</h1>
- <p>使用CSS(Cascading Style Sheets),可以使网页样式更加的丰富多彩,它解决内容与表现分离的问题,提高了工作效率。</p>
- </body>
-
- </html>
.css
- /* ********** BEGIN ********** */
- body {
- background-color: ivory;
- }
-
-
- /* ********** END ********** */
-
- h1 {
- font-size: 40px;
- text-align: center;
- }
-
- p {
- font-size: 18px;
- color: grey;
- /* ********** BEGIN ********** */
- background-color: lightblue;
- /* ********** END ********** */
- }
.html
- <!DOCTYPE html>
- <html>
-
- <head>
- <meta charset="utf-8">
- <title>Hello World</title>
- <link rel="stylesheet" href="step2/CSS/style.css">
- </head>
-
- <body>
- <div>
- <h1>CSS让网页样式更丰富</h1>
- <p>这是一个段落</p>
- </div>
- </body>
-
- </html>
.css
- body {
- /* ********** BEGIN ********** */
- /*设置背景图片*/
- background-image: url(https://educoder.net/api/attachments/211106);
-
- /* ********** END ********** */
- }
-
- div {
- width: 90%;
- height: 100%;
- margin: auto;
- }
.html
- <!DOCTYPE html>
- <html>
-
- <head>
- <meta charset="utf-8">
- <title>Hello World</title>
- <link rel="stylesheet" href="step3/CSS/style.css">
- </head>
-
- <body>
- <div>
- <h1>CSS让网页样式更丰富</h1>
- <p>这是一个段落</p>
- </div>
- </body>
-
- </html>
.css
- body {
- margin-right: 200px;
- /* ********** BEGIN ********** */
- /*设置背景图片*/
- background:url(https://educoder.net/api/attachments/211104) no-repeat fixed right top;
- /* ********** END ********** */
- }
-
- div {
- width: 90%;
- height: 100%;
- margin: auto;
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。