当前位置:网站首页>: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元素(必须在结构倒数第一位)
边栏推荐
- [shutter] shutter layout component (opacity component | clipprect component | padding component)
- Chinese Indian seasoning market trend report, technical dynamic innovation and market forecast
- [zero foundation I] Navicat download link
- [shutter] shutter page Jump (route | navigator | page close)
- How do I access the kubernetes API?
- Cloud computing technology [2]
- [C language] [sword finger offer article] - replace spaces
- [CV] Wu Enda machine learning course notes | Chapter 12
- It is said that this year gold three silver four has become gold one silver two..
- 地理探测器原理介绍
猜你喜欢

Spend more time with your computer on this special holiday, HHH

MySQL learning record (3)

Pip install whl file Error: Error: … Ce n'est pas une roue supportée sur cette plateforme

Welfare, let me introduce you to someone

MySQL learning record (6)

Five message formats of OSPF

读博士吧,研究奶牛的那种!鲁汶大学 Livestock Technology 组博士招生,牛奶质量监测...

Capacity expansion mechanism of ArrayList

MySQL learning notes (Advanced)

Check the confession items of 6 yyds
随机推荐
[CV] Wu Enda machine learning course notes | Chapter 12
Spend more time with your computer on this special holiday, HHH
Construction and maintenance of business websites [10]
Research Report on crude oil tanker industry - market status analysis and development prospect forecast
Construction and maintenance of business websites [4]
Cloud computing technology [1]
Cardinality sorting (detailed illustration)
记录一下微信、QQ、微博分享web网页功能
【剑指 Offer 】56 - II. 数组中数字出现的次数 II
China's Micro SD market trend report, technology dynamic innovation and market forecast
Golang string segmentation
Plastic floating dock Industry Research Report - market status analysis and development prospect forecast
China's crude oil heater market trend report, technological innovation and market forecast
MySQL learning record (2)
How do I access the kubernetes API?
3DES (deSede) encryption CBC mode pkcs7padding filling Base64 encoding key 24byte iv8byte
Cloud computing technology [2]
Gbase8s database type
Blue Bridge Cup Winter vacation homework (DFS backtracking + pruning)
Gee: (II) resampling the image