开发者

How to apply css label for only a specified class

开发者 https://www.devze.com 2023-04-01 20:33 出处:网络
I\'m trying to make the first label bold (row 1) and then the second one (row 2) not use the div.row label declaration.How would I do that? I was thinking that by doing div.row label it will only appl

I'm trying to make the first label bold (row 1) and then the second one (row 2) not use the div.row label declaration. How would I do that? I was thinking that by doing div.row label it will only applied to all the label in开发者_JAVA百科side a div class="row"

div.row label{
    font-weight: bold;
}

<div class="row"><label>row 1</label> : <input type="text"/></div>
<div><label>row 2</label> : <input type="text"/></div>


Depending on how variable your structure is, you can use div.row:first-child { /css here/ } or div.row:nth-child(n) { /css here/ } to select the elements within the div of the chosen class

0

精彩评论

暂无评论...
验证码 换一张
取 消