課程
/前端開發
/HTML/CSS
/CSS深入理解之absolute
.list:after?{ ?content:attr(data-index);
這個attr(data-index)是什么鬼
2015-07-20
源自:CSS深入理解之absolute 7-4
正在回答
content表示的是在html中加上的內容,也就是加上attr(data-index);的值,其中attr(data-index)指的是<div class="list" data-index="1"></div>中的屬性data-index的值,attr和js相似就是獲取div標簽中的某個屬性的值。
在list類后加上偽類after,偽類的內容是屬性data-index的值
Sets the content as one of the selector's attribute.The attr() property inserts a specified attribute's value after the selected element(s).
舉報
理解CSSposition:absolute聲明,掌握position:absolute高級應用
2 回答:before和:after這么神奇的
3 回答額。這里.close為什么用margin屬性而不用top和right屬性呢?
2 回答如果移除了absolute屬性
3 回答怎么理解圖片的默認屬性是inline-block
3 回答不太懂
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網安備11010802030151號
購課補貼聯系客服咨詢優惠詳情
慕課網APP您的移動學習伙伴
掃描二維碼關注慕課網微信公眾號
2016-03-18
content表示的是在html中加上的內容,也就是加上attr(data-index);的值,其中attr(data-index)指的是<div class="list" data-index="1"></div>中的屬性data-index的值,attr和js相似就是獲取div標簽中的某個屬性的值。
2015-12-26
在list類后加上偽類after,偽類的內容是屬性data-index的值
2015-11-03
Sets the content as one of the selector's attribute.The attr() property inserts a specified attribute's value after the selected element(s).