当前位置:网站首页>:last-child 不生效解决
:last-child 不生效解决
2022-07-02 21:32:00 【小白目】
结构:
<div class="titleContent">
<div>导航点击栏</div>
<p>{
{ AthenaData.titleLabel }}</p>
<h1>牌力觉醒 等你来斗</h1>
<p>翻牌得门票,参赛赢好礼!</p>
<div class="ticketInfo">
我的入场券
<span>初赛:1</span>
<span>复赛:0</span>
<span>决赛:0</span>
<button>立即开斗</button>
</div>
</div>
想给 <p>翻牌得门票,参赛赢好礼!</p> 文字加粗:
样式:
p:last-child{
font-weight: 700;
}
发现不生效。
解决办法:
p:last-of-type{
font-weight: 700;
}
总结:
p:first-of-type :同级结构内首次出现的P元素(无须在结构第一位)
p:last-of-type :同级结构内最后出现的P元素(无须在结构倒数第一位)
p:first-child :父元素下的第一个P元素(必须在结构第一位)
p:last-child :父元素(body除外)下的最后一个P元素(必须在结构倒数第一位)
边栏推荐
- Analysis of enterprise financial statements [3]
- Research Report on market supply and demand and strategy of China's Plastic Geogrid industry
- Construction and maintenance of business website [1]
- Accounting regulations and professional ethics [16]
- MySQL learning record (6)
- [use of pointer and pointer and array]
- 【剑指 Offer】56 - I. 数组中数字出现的次数
- Baidu sued a company called "Ciba screen"
- B.Odd Swap Sort(Codeforces Round #771 (Div. 2))
- #include<>和#include“”的区别
猜你喜欢
How is LinkedList added?
D4: unpaired image defogging, self enhancement method based on density and depth decomposition (CVPR 2022)
发现你看不到的物体!南开&武大&ETH提出用于伪装目标检测SINet,代码已开源!...
MySQL learning record (5)
Five message formats of OSPF
The neo4j skill tree was officially released to help you easily master the neo4j map database
MySQL learning record (3)
[shutter] shutter page Jump (route | navigator | page close)
How to test the process of restoring backup files?
[zero foundation I] Navicat download link
随机推荐
Analysis of enterprise financial statements [4]
Chinese Indian seasoning market trend report, technical dynamic innovation and market forecast
Read a doctor, the kind that studies cows! Dr. enrollment of livestock technology group of Leuven University, milk quality monitoring
Investment strategy analysis of China's electronic information manufacturing industry and forecast report on the demand outlook of the 14th five year plan 2022-2028 Edition
Five message formats of OSPF
Golang embeds variables in strings
Blue Bridge Cup Eliminate last one (bit operation, code completion)
MySQL learning record (6)
Accounting regulations and professional ethics [18]
pyqt圖片解碼 編碼後加載圖片
[shutter] statefulwidget component (bottom navigation bar component | bottomnavigationbar component | bottomnavigationbaritem component | tab switching)
D4:非成对图像去雾,基于密度与深度分解的自增强方法(CVPR 2022)
SQL必需掌握的100个重要知识点:管理事务处理
Summary of the first week of summer vacation
MySQL learning notes (Advanced)
[Yu Yue education] reference materials of analog electronic technology of Nanjing Institute of information technology
加了定位的文字如何水平垂直居中
B.Odd Swap Sort(Codeforces Round #771 (Div. 2))
Spend more time with your computer on this special holiday, HHH
SQL必需掌握的100个重要知识点:使用游标