html基礎(選取器,font屬性 )

來源:互聯網
上載者:User

標籤:inpu   value   hover   isp   title   css選取器   nbsp   12px   visit   

css選取器   css與html的關係 css以html為基礎css主要設定的就是html標籤中的屬性樣式,css進行網頁布局。  css文法選取器{屬性:值,屬性:值}  css選取器 基本選取器
*{margin:0; padding:0}網頁中所以的標配都可以用p{ font-size:2px }標籤選取器.input{background:#ffo}p.info{background:red} p下面類名是info的標籤#footer{ background:red; }p#info{ background:red; }p下面id是#info的標籤

 

多元素選取器

div,p{ color:#f00 }多元素選取器ul li{ display:inline;}後代選取器ul>li{ displa:inline; }子項目選取器div+p{ color:#f00;}毗鄰元素選取器

 

屬性選取器

E[att]<style>  div[title]{ color:red }</style><div title="哈哈"></div><div class="acb"></div>命中第一個div,
E[att=val]
<style> div[class*="b"]{ color:red } input[type="text"]{ foot:12px; }</style>
命中所有div,因為匹配到了class屬性,屬性值都包含了b<div class="abc"></div><div class="acb"></div>
只匹配第一個input<input type="text" name="Name"/><input type="button" name="Name"/>

 

偽類別選取器

p:frist-child{ font:12px } 匹配父元素第一個子項目
a:link{ color:red; }/* 未被訪問的連結 */a:visited{color:red }/* 已被訪問的連結 */a:hover{ color:red;}/* 滑鼠指標移動到連結上 */a:active{ color: red;}/* 正在被點擊的連結 */
style type="text/css">  input[type=text]:focus  { background:red; color:#fff}</style>
<body> <input type="text" value="skss" /></body>匹配獲得當前焦點的元素
<style>  p:before{ content:‘台詞‘};</style><p>開始</p>//台詞開始  在E元素之前插入產生的內容
<style>  p:after{ content:‘台詞‘}</style><p>開始</p>//開始台詞   在E元素之後插入產生的內容

 

html基礎(選取器,font屬性 )

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.