+ 1
How do I apply bgcolor to a specific paragraph not the whole body
Html
7 Antworten
+ 3
In css
p{
Background-color:blue;
}
In html
<Head>
<style>
p{
Background-color:blue;
}
</style>
</head>
Learn css
+ 2
Go to your paragraph which is obviosly <p>Your Paragraph</p>..
Then put 'class' attribute inside the first <p>.. you get👇👇
<p class="paragraph">Your Paragraph</p>
Then go to css section..
Start with a dot and write paragaph(which is is your value.. it can be anything you asign it to) like this👇
.paragraph{
background-color: red;
color:black;
}
Try it.. but you should learn CSS, which is pretty easy to learn
+ 1
Thanks Abhay🤓
0
It's not responding!
0
Yup because it is background-color ,small b ,sorry forgot to change
0
Is the p the one before a paragraph <p? Or I apply separately before a paragraph?
0
You can do inline styling by applying the desired style in the opening tag eg.<p bgcolor="blue"></p>
Or you do external css by giving the assigning an id or class to the <p> eg. <p id="1"></p>or<p class="1"></p>, then go to css and apply the styles.
Remember for id use '#1' to identify the id and '.1' to identify class.