0
Selector-paragraphs
P{color="red";} applies to all paragraphs..what if you want to style just one paragraph out of a given number of paragraphs
4 Respostas
+ 3
If you want to style just one paragraph out of a given number of paragraphs, you need to apply the id or class attribute to that paragraph. For example:
HTML:
<p id="first_paragraph">Hello</p><!--id is a unique attribute, and only one tag should use it-->
<p class="blue_paragraph">World!</p><!--classes, on the other hand, can be used for multiple tags-->
CSS:
#first_paragraph
{
color: orange;
}
.blue_paragraph
{
color: blue;
}
Try it out, this should be in the CSS course here.
+ 3
Have an ID set for that one paragraph, and define the specification in CSS.
* HTML
<p id="diff">this is one of a kind</p> <!-- color will be red -->
<p>just a regular paragraph</p> <!-- color will be default -->
* CSS
p#diff { color: red; }
+ 2
Thank you
+ 1
Yes thanks a lot...and I've also seen what you said in the lessons