1. 程式人生 > >css樣式屬性

css樣式屬性

lac ive splay ota div meta text type css

css樣式屬性比HTML用標簽來添加方便很多,樣式也比較多樣。不過需要記得東西就更多了。

按 鈕 ABCD 1234
  • 1
  • 2
  • 3
  • 4

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.d1{
width: 100px;
height: 30px;
border: 1px solid black;
text-align: center;
line-height: 30px;
/*圓角*/
border-radius: 10px;
}
.d1:hover{
background-color: greenyellow;
color: red;
/*漸變效果*/
transition: 1s;
/*陰影*/
box-shadow: 5px 5px 5px black;
text-shadow: 2px 2px 2px black;
/*旋轉*/
/*transform: rotate(5deg);*/
/*3D旋轉*/
transform: rotateY(360deg);
/*平移*/
/*margin-left:10px;*/
/*半透明*/
opacity: 0.5;
}
a{
text-decoration: none;
color: black;
}
.d2{
width: 100px;
height: 100px;
border: 1px solid black;
position: relative;
}
.d2 div{
width:30px;
height: 40px;
border: 1px solid black;
position: relative;
}
#xxx{
width: 30px;
height: 20px;
/*隱藏占用位置*/
/*visibility:hidden;*/
/*隱藏不占用位置*/
display: none;
}
.d2:hover #xxx{
color: red;
}
/*列表常用樣式*/
ul{
/*list-style:none;*/
list-style-image: url(../img/QQ圖片20170711172838.gif);
}
ul li{
/*float:left*/
width: 50px;
}
</style>
</head>
<body>
<a href="#"><div class="d1">按&nbsp;鈕</div></a>
<div class="d2">
<div id="xxx">ABCD</div>
<div>1234</div>
</div>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
</ul>
</body>
</html>

css樣式屬性