I’m still testing everything I learn and one of the things I tried to test today was to make the first letter of some of my paragraphs big and bold . I put this on my CSS sheet:
p: first-letter
{
float: left;
font-size: 3em;
font-family: Arial, Georgia, “Times New Roman”, Times, serif;
font-weight: bold;
margin-right: 5px;
}
It worked fine. The only problem is that I don’t want it in all my paragraphs. I only want it in one paragraph, and this paragraph already has a class (border).
My question is : Is it possible to have two classes in one paragraph? If so, how do we add it?
I’m just hoping it’s not a dumb question:)
Thanks in advance
EDIT: To wok in older browsers (that don’t recognize :first-letter) you could instead wrap the first letter in a <span> and apply the styles to that. E.g.
Ralph: It works perfectly!!! I have two questions though!
What do we call first-letter? It’s a class, an attribute, a property?
How come the first-letter was applied only to 3 paragraphs and not to all my paragraphs and how can I apply it to the first paragraph only?
Then it’s being applied to any <p> element with a class of border: <p class=“border”> If you want to apply it to only one paragraph, give that paragraph a unique class name and target that: <p class=“first”> p.first:first-letter. ‘first’ is just an example it can be changed.