day03--百度首页【37】头部界面;【38】头部样式;【39】表单(上);【40】表单(下);【41】列表(上);【42】列表左边;【43】列表右边;【44】内容回顾

 

 index.html:主页面

 

  1 <!DOCTYPE html>
  2 <html lang="en">
  3 <head>
  4     <meta charset="UTF-8">
  5     <title>百度一下, 你就不知道</title>
  6     <link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
  7     <link rel="stylesheet" href="css/index.css">
  8 </head>
  9 <body>
 10 <!--头部-->
 11 <header id="header">
 12     <!--左边-->
 13     <div class="header-left">
 14             <span>
 15                 <img src="images/weather.png" alt="" align="center">
 16             </span>
 17         <span class="msg-span">
 18                 <span>|</span>
 19                 <a href="#">换肤</a>
 20                 <a href="#">消息</a>
 21             </span>
 22     </div>
 23     <!--右边-->
 24     <div class="header-right">
 25         <a href="">新闻</a>
 26         <a href="">hao123</a>
 27         <a href="">地图</a>
 28         <a href="">学术</a>
 29         <a href="http://www.itlike.com">撩课学院</a>
 30         <a href="" class="more-product">更多产品</a>
 31     </div>
 32 </header>
 33 <!--搜索-->
 34 <section id="content">
 35     <!--logo-->
 36     <div class="logo">
 37         <img src="images/bd_logo.png" alt="百度logo">
 38     </div>
 39     <div class="search">
 40         <form action="http://www.itlike.com">
 41             <input name="content" type="text" class="search-input">
 42             <input name="btn" type="submit" class="search-submit" value="百度一下">
 43         </form>
 44     </div>
 45     <!--搜索-->
 46 </section>
 47 <!--列表-->
 48 <section id="list">
 49     <!--头部-->
 50     <div class="list-head">
 51         <!--左边-->
 52         <div class="list-head-left">
 53             <a href="">
 54                 <img src="images/person_icon.png" alt="">
 55                 <span>我的关注</span>
 56             </a>
 57             <a href="">
 58                 <span>推荐</span>
 59             </a>
 60             <a href="">
 61                 <span>导航</span>
 62             </a>
 63         </div>
 64         <!--右边-->
 65         <div class="list-head-right">
 66             <a href="#">
 67                 <img src="images/setting_icon.png" alt="">
 68             </a>
 69         </div>
 70     </div>
 71     <!--内容-->
 72     <div class="list-content">
 73         <!--内容的左边-->
 74         <div class="list-content-left">
 75             <!--1-->
 76             <div class="list-content-cell1">
 77                 <h3>大满贯14冠!德约3-0完胜波特罗 美网三度封王</h3>
 78                 <img src="images/cell_img1.png" alt="">
 79                 <img src="images/cell_img2.png" alt="">
 80                 <img src="images/cell_img3.png" alt="">
 81                 <p>网易新闻 09-20 13:19</p>
 82             </div>
 83             <!--2-->
 84             <div class="list-content-cell2">
 85                 <div class="cell-img">
 86                     <img src="images/cell_img1.png" alt="">
 87                 </div>
 88                 <div class="cell-title">
 89                     <h3>大满贯14冠!德约3-0完胜波特罗 美网三度封王</h3>
 90                     <p>网易新闻 09-10 13:19</p>
 91                 </div>
 92             </div>
 93             <!--3-->
 94             <div class="list-content-cell2">
 95                 <div class="cell-img">
 96                     <img src="images/cell_img2.png" alt="">
 97                 </div>
 98                 <div class="cell-title">
 99                     <h3>大满贯14冠!德约3-0完胜波特罗 美网三度封王</h3>
100                     <p>网易新闻 09-10 13:19</p>
101                 </div>
102             </div>
103         </div>
104         <!--内容的右边-->
105         <div class="list-content-right">
106             <div class="right-top">
107                 <h4>实时热点</h4>
108                 <div>
109                     <img src="images/circle_icon.png" alt="">
110                     <span>换一换</span>
111                 </div>
112             </div>
113             <div class="right-body">
114                 <ul>
115                     <li>高晓松 丁香医生</li>
116                     <li>中国参加俄军演</li>
117                     <li>高晓松 丁香医</li>
118                     <li>中国参加俄军演</li>
119                     <li>高晓松 丁香医生</li>
120                     <li>中国参加俄军演</li>
121                     <li>高晓松 丁香医</li>
122                     <li>中国参加俄军演</li>
123                     <li>高晓松 丁香医生</li>
124                     <li>中国参加俄军演</li>
125                     <li>高晓松 丁香医</li>
126                     <li>中国参加俄军演</li>
127                 </ul>
128             </div>
129         </div>
130     </div>
131 </section>
132 </body>
133 </html>

1、拿进图标:

link:favicon--->tab键--->
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">

 2、引入index.css(样式文件)

<link rel="stylesheet" href="css/index.css">

 

  1 * {
  2     margin: 0;
  3     padding: 0;
  4 
  5     box-sizing: border-box;
  6 }
  7 
  8 body {
  9     /*margin-bottom: 200px;*/
 10 }
 11 
 12 /************************头部-start**********************/
 13 #header {
 14     height: 33px;
 15     border-bottom: 1px solid #ebebeb;
 16 }
 17 
 18 #header a {
 19     color: #555555;
 20     font-size: 13px;
 21 }
 22 
 23 #header .header-left {
 24     width: 270px;
 25     height: 33px;
 26     float: left;
 27     line-height: 33px;
 28 }
 29 
 30 #header .header-left a {
 31     margin-left: 8px;
 32 }
 33 
 34 #header .header-right {
 35     width: 600px;
 36     height: 33px;
 37     float: right;
 38     text-align: right;
 39     line-height: 33px;
 40 }
 41 
 42 #header .header-right a {
 43     font-weight: bolder;
 44     margin-left: 15px;
 45 }
 46 
 47 #header .header-right a.more-product {
 48     background-color: #398bfb;
 49     /*行内 --> 行内-块级*/
 50     display: inline-block;
 51     width: 86px;
 52     height: 33px;
 53     line-height: 33px;
 54     text-align: center;
 55     color: #fff;
 56     text-decoration: none;
 57 
 58     vertical-align: top;
 59 }
 60 
 61 /************************头部-end**********************/
 62 
 63 /************************搜索-start**********************/
 64 #content {
 65     width: 641px;
 66     height: 189px;
 67     margin: 20px auto;
 68     /*background-color: green;*/
 69 }
 70 
 71 #content .logo {
 72     /*background-color: red;*/
 73     text-align: center;
 74     width: 641px;
 75     height: 112px;
 76 }
 77 
 78 #content .logo img {
 79     width: 270px;
 80     height: 112px;
 81 }
 82 
 83 #content .search {
 84     width: 100%;
 85     height: 77px;
 86     /*background-color: skyblue;*/
 87     padding-top: 10px;
 88 }
 89 
 90 #content .search form {
 91     width: 100%;
 92     height: 44px;
 93     /*background-color: purple;*/
 94 }
 95 
 96 #content .search form .search-input {
 97     width: 536px;
 98     height: 44px;
 99     padding-left: 8px;
100 
101     /*去除外边框*/
102     outline: none;
103 
104     border: 1px solid #e0e0e0;
105 
106     float: left;
107 }
108 
109 #content .search form .search-input:focus {
110     border-color: #398bfb;
111 }
112 
113 #content .search-submit {
114     width: 105px;
115     height: 44px;
116     background-color: #398bfb;
117     border: none;
118     float: left;
119     color: #fff;
120     font-size: 16px;
121 
122     /*去除外边框*/
123     outline: none;
124 }
125 
126 /************************搜索-end**********************/
127 
128 /************************列表-start**********************/
129 #list {
130     width: 893px;
131     height: 600px;
132     border: 1px solid #ebebeb;
133     margin: 0 auto;
134 }
135 
136 #list .list-head {
137     height: 40px;
138     line-height: 40px;
139     border-bottom: 1px solid #ebebeb;
140 }
141 
142 #list .list-head .list-head-left {
143     float: left;
144     /*解决空格留白的问题*/
145     font-size: 0;
146 }
147 
148 #list .list-head .list-head-left a {
149     display: inline-block;
150     height: 40px;
151     line-height: 40px;
152     /*background-color: red;*/
153 
154     font-size: 14px;
155     text-decoration: none;
156     padding: 0 10px;
157 
158     color: #555555;
159     vertical-align: top;
160 }
161 
162 #list .list-head .list-head-left a img,
163 #list .list-head .list-head-left a span {
164     vertical-align: middle;
165 }
166 
167 #list .list-head .list-head-left a:hover {
168     background-color: #cccccc;
169 }
170 
171 #list .list-head .list-head-right {
172     float: right;
173     margin-right: 10px;
174 }
175 
176 #list .list-head .list-head-right img {
177     vertical-align: middle;
178 }
179 
180 /*列表内容*/
181 #list .list-content {
182 
183 }
184 
185 #list .list-content .list-content-left {
186     width: 575px;
187     height: 600px;
188     /*background-color: red;*/
189     float: left;
190     padding: 10px 5px 5px 10px;
191 }
192 
193 #list .list-content .list-content-left .list-content-cell1 {
194     border-bottom: 1px solid #e0e0e0;
195     padding-bottom: 5px;
196 }
197 
198 #list .list-content .list-content-left .list-content-cell1 h3 {
199     margin-bottom: 10px;
200 }
201 
202 #list .list-content .list-content-left .list-content-cell1 p {
203     margin: 3px 0;
204     color: #555555;
205     font-size: 12px;
206 }
207 
208 #list .list-content .list-content-left .list-content-cell2 {
209     padding: 20px 0;
210     height: 160px;
211     border-bottom: 1px solid #e0e0e0;
212 }
213 
214 #list .list-content .list-content-left .list-content-cell2 .cell-img {
215     float: left;
216 }
217 
218 #list .list-content .list-content-left .list-content-cell2 .cell-title{
219     float: left;
220     width: 360px;
221     padding: 20px;
222 }
223 
224 #list .list-content .list-content-left .list-content-cell2 h3 {
225     margin-bottom: 10px;
226 }
227 
228 #list .list-content .list-content-left .list-content-cell2 p {
229     margin: 3px 0;
230     color: #555555;
231     font-size: 12px;
232 }
233 
234 #list .list-content .list-content-right{
235     width: 315px;
236     height: 600px;
237     /*background-color: red;*/
238     float: left;
239 }
240 
241 #list .list-content .list-content-right .right-top{
242     height: 60px;
243     width: 315px;
244     /*background-color: green;*/
245     padding: 20px;
246 }
247 
248 #list .list-content .list-content-right .right-top h4{
249     float: left;
250 }
251 
252 #list .list-content .list-content-right .right-top div{
253     float: right;
254 }
255 
256 #list .list-content .list-content-right .right-top div img,
257 #list .list-content .list-content-right .right-top div span{
258     vertical-align: middle;
259 }
260 
261 #list .list-content .list-content-right .right-body{
262     /*background-color: red;*/
263     padding: 0 20px;
264 }
265 
266 #list .list-content .list-content-right .right-body ul li{
267     list-style: none;
268     width: 130px;
269     height: 40px;
270     line-height: 40px;
271     float: left;
272 
273     color: #666666;
274     font-size: 14px;
275 }
276 
277 /************************列表-end**********************/

 

 

从边框往里面走,不会随着后续动作导致边框大小改变
* { margin: 0; padding: 0; box-sizing: border-box; }

 

 3、a*2两个a标签:<a href=""></a><a href=""></a>

4、

 

先复制新闻等文字,然后鼠标放到新闻处

按下Alt键,鼠标往下拉:

然后输入a:

最后tab键,完成

【视频38】

 

 

 

 





 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

posted @ 2019-07-11 15:35  慕少溪梓  阅读(211)  评论(0编辑  收藏  举报