View Single Post
Old 07-18-2022, 07:17 PM   #9
RbnJrg
Wizard
RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.RbnJrg ought to be getting tired of karma fortunes by now.
 
Posts: 1,820
Karma: 8700631
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
Quote:
Originally Posted by Tex2002ans View Post
Yes, you'll want to use the background-color CSS:

HTML:

Code:
<div class="red">
	<p>This is going to have a red background.</p>
</div>

<p class="blue">This is a blue background too.</p>
CSS:

Code:
div.red {
	background-color: red;
}

p.blue {
	background-color: blue;
}
It's not neccesary to employ "background-color"; just writting "background" will work because that it is a shorthand for background-color, background-image, background-size, background: position, background-repeat, etc.; it doesn't matter if one of the values are missing. So, "background: blue" it'll be a shorthand for "background-color: blue"; background: 100%, it'll be a shorthand for "background-size: 100%"; even you can use something like: "background: blue url("path_to_an_image")"; if the image is present, then the image will be showed, but if not, then the color blue will be displayed as background.
RbnJrg is offline   Reply With Quote