You could use the :first-child
pseudo class :
ul:first-child {
color: red;
}
First list
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
Second list
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
You could use the :first-child
pseudo class :
ul:first-child {
color: red;
}
First list
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
Second list
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
</ul>
I found the way..i used ul:first-of-type and ul:last-of-type. Thanks anyway.
I’m new to CSS, I’m interested in how to choose the first sheet from an html document to style if I don’t have a div or class in either.
First list –
Second list –
I want to target just one without putting class or div to html file.
I tried to do nth child etc functions but its change both lists
It should be more clear for us to answer if you include the example in an HTML code. If your text has no tags at all, then it should have for countless reasons.
Can you post your HTML structure? and exactly what do you want?