Why isn’t my first-child selector working in Less?
.leftPanel{
margin:20px;
float:left;
display:inline;
width:620px;
margin-left:10px;
select{
width:300px;
&:first-child{
margin-right: 30px;
}
}
}
You are specifying that if the first child element inside a
.leftPanelis a<select>, it should havemargin-right: 30px;. If you are trying to apply this rule to the first child element inside the<select>(which should always be an<option>), try replacing&:first-childwithoption:first-child.