CSS选取器的权重弥补
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span>应该早就<span style="color: black;">晓得</span>了CSS<span style="color: black;">选取</span>器的优先级</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">例如</span>:</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">基本</span><span style="color: black;">选取</span>器权重:!important > 行内 > id > 类 > 标签 > 通配符</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其实<span style="color: black;">便是</span>看范围,理论上能选中内容越多的<span style="color: black;">选取</span>器那它的权重<span style="color: black;">必定</span>是最小的,<span style="color: black;">那样</span>id和行内样式选中范围是对等的,<span style="color: black;">她们</span>之间就<span style="color: black;">能够</span>用就近原则去理解</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">咱们</span><span style="color: black;">亦</span>都在网上<span style="color: black;">认识</span>过,<span style="color: black;">晓得</span>各个<span style="color: black;">选取</span>器的<span style="color: black;">详细</span>权重值</p>!important 10000行内 1000id 100类 10标签 1通配符 0继承样式<span style="color: black;">无</span>权重值<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">虽然<span style="color: black;">这般</span>你更好理解,更好记忆了,<span style="color: black;">然则</span>其实这不是完全正确的</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">你们学到这儿可能<span style="color: black;">始终</span>都以为10个标签等于一个类,10个类等于1个id吧?</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">但<span style="color: black;">并不</span>是如此,id真的不等于10个类,而一个类<span style="color: black;">亦</span>并不等于10个标签</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">不信?你试试就<span style="color: black;">晓得</span>了!</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">她们</span>不存在比例关系,经过测试<span style="color: black;">发掘</span>,256个类等价于1个id,<span style="color: black;">因此</span>以后写网页,<span style="color: black;">选取</span>器规划很<span style="color: black;">要紧</span>,不要在前面就频繁<span style="color: black;">显现</span>id<span style="color: black;">选取</span>器,到时候优先级问题<span style="color: black;">引起</span>样式<span style="color: black;">没</span>法覆盖,还妄图用10个类去和id比一比,那就太天真了~</p>
<p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">目录:</p>
<div style="color: black; text-align: left; margin-bottom: 10px;"><a style="color: black;"><span style="color: black;"><span style="color: black;">写在开头</span><span style="color: black;">11 赞同 · 7 评论<span style="color: black;"><span style="color: black;">文案</span></span></span></span><span style="color: black;"><img src="https://picx.zhimg.com/v2-12b8d264ff5f551c3af2f12ef6011c81_r.jpg?source=172ae18b" style="width: 50%; margin-bottom: 20px;"></span></a></div>
外贸B2B平台有哪些?
页:
[1]