how do I select a single tag in the middle of many of the same in CSS? -
I have a single "P" tag with many other "P" tags inside the "div" tag. I select only one single tag among those other people so that I can change my style to CSS? I am very new to HTML and CSS, so sorry, this is a stupid question. Thanks!
You can use Or like Mark B commented, add a class for it. or same : nth-child
. Therefore the second & lt; P & gt;
and
inside
div p: nth-child (2)
.
gt; & Lt; P & gt; Hi, & lt; / P & gt; & Lt; P class = 'lionel' & gt; This is me & lt; and < / P>
div p.lionel {font-weight: bold;}
& lt; P & gt; By using
: nth-child ()
di V p: nth-child (2) {font-weight: bold; }
Comments
Post a Comment