第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么:before和:after偽元素需要'content'屬性?

為什么:before和:after偽元素需要'content'屬性?

胡說叔叔 2019-08-05 15:40:30
為什么:before和:after偽元素需要'content'屬性?鑒于以下場景,為什么:after選擇器需要內(nèi)容屬性才能運(yùn)行?.test {     width: 20px;     height: 20px;     background: blue;     position:relative;} .test:after {     width: 20px;     height: 20px;     background: red;     display: block;     position: absolute;     top: 0px;     left: 20px;}<div class="test"></div>注意在指定content屬性之前如何看不到偽元素:.test {     width: 20px;     height: 20px;     background: blue;     position:relative;} .test:after {     width: 20px;     height: 20px;     background: red;     display: block;     position: absolute;     top: 0px;     left: 20px;     content:"hi";}<div class="test"></div>為什么這是預(yù)期的功能?你會認(rèn)為顯示塊會強(qiáng)制元素出現(xiàn)。奇怪的是,您實(shí)際上可以在Web調(diào)試器中看到樣式; 但是,它們不會顯示在頁面上。
查看完整描述

3 回答

  • 3 回答
  • 0 關(guān)注
  • 2688 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號