Blogger Information
Blog 32
fans 0
comment 0
visits 21390
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
3月24日作业
inhylei
Original
691 people have browsed it

代码

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.box{
width: 200px;
height: 200px;
background: red;
text-align: center;/*使行内元素在块元素中水平居中*/

}
.box p {
line-height: 200px;
}
.box1 {
width: 200px;
height: 200px;
text-align: center;
background: green;
display: table-cell;/*将当前块显示方式改为表格单元格方式*/
vertical-align: middle;/*设置单元格内元素垂直居中*/
}
.box2 {
width: 200px;
height: 200px;
background: yellow;
display: table-cell;
vertical-align: middle;

}
   .box2 .pad{
    width: 100px;
    height: 100px;
    background: red;
    margin: auto;/*auto 指用浏览器自动计算位置*/

   }
   .box3 {
    width: 200px;
    height: 200px;
    background: blue;
    display: table-cell;
    vertical-align: middle;     
   }

   .box4{
    width: 200px;
    height: 200px;
    background: skyblue;
    display: table-cell;
    vertical-align: bottom;
    text-align: center;
   }
   .box4 ul {
    padding-left: 0;

   }
   .box4 li {
         list-style: none;
         display: inline;
   }

</style>
</head>
<body>
<div>
<p>这是一行元素</p>
</div>
<br><br>
<div>
<span>这是多行元素</span>
<br>
<span>这是多行元素</span>
</div>
<br>
    
    <div><div></div></div>
<br>
    <div>
     <ul>
     <li>1</li>
     <li>2</li>
     <li>3</li>
     <li>4</li>
     </ul>
    </div>
</body>
</html>

手抄代码


QQ图片20180326102034.jpg

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post