溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

html基礎(chǔ)-CSS

發(fā)布時間:2020-03-23 04:46:10 來源:網(wǎng)絡(luò) 閱讀:550 作者:M_x_M 欄目:web開發(fā)

1.id選擇器

#id1{
    backgroud-color:
}
<div id="id1">1</div>

2.類選擇器

.c1{
    backgroud-color:
}
<div class="c1">1</div>

3.標(biāo)簽選擇器

div{
    backgroud-color:
}
<div>1</div>

4.層級選擇器

div div{#div下的div
    backgroud-color:
}
<div>
    <div>1</div>
</div>

5.組合選擇器

.c1,.c2,.3{
    backgroud-color:
}
<div class=“c1”>1</div>
<div class=“c2”>2</div>
<div class=“c3”>3</div>

6.屬性選擇器

.c1[type="text]{
    backgroud-color:
}
<input type="text" />
<input type="password"/>

7.屬性
7.1邊框

border{
1px solid #ff6600  #dotted
}

7.2.float

{
float:left;
float:right;
clear:both;#清除浮動
}

7.3.display

{
#塊級標(biāo)簽和行內(nèi)標(biāo)簽切換
display:inline;#轉(zhuǎn)為行內(nèi)
display:block;#轉(zhuǎn)為塊級
#行內(nèi)標(biāo)簽無法設(shè)置寬度和高度,margin,padding
display:inline-block; 
display:none;#標(biāo)簽消失
}

7.4.padding margin

{
margin:外邊距
padding:內(nèi)邊距
}

7.5.text-align

#文字對齊
{
text-align:center;
}

7.6 height,width,line-height

{
height:100px;
width:20%;
line-height:20px;
}

7.7.font

{
font-size:20px;
font-weight:700;
}

8.定義整體寬度

body{
    width:980px;
    margin:0 auto;
}

9.css重用

<style>
.c{
    重用
}
.c1{
    獨(dú)有
}
.c2{
    獨(dú)有
}
<div class="c c1"></div>#應(yīng)用c和c1的樣式
<div class="c c2"></div>#應(yīng)用c和c2的樣式
</style>

10.自適應(yīng)media

@media (min-width: 992px){

}

11.position
11.1.position:fixed;固定模塊

{
position:fixed;
top:0;
left:0;
bottom:0;
right:0;
}

11.2.position:absolute;#絕對定位

{
position:absolute;
}

11.3.position:relative+absolute

<div >
    <div >11</div>#可以控制內(nèi)部div相對于上層div移動
</div>

11.4.z-index控制顯示層級,越大越往上

{
<div ></div>
}

12.opaciy透明度

{
opacity:0.3;
}

13.overflow內(nèi)容超出隱藏或呈現(xiàn)滾動條

{
    overflow:hidden;
    overflow:auto
}

14.:hover用于鼠標(biāo)懸浮后樣式改變
15.background-img,background-repeat,background-position-x,background-position-y使用

#使用了postion,background,display屬性
<div >
    <input type="text"  />
    <span ></span>
</div>

html基礎(chǔ)-CSS

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

css
AI