This article provides HTML background code - code for setting the background properties of an HTML element.
The following examples use Cascading Style Sheets (CSS). CSS is the best way of setting the background properties in your HTML. It's more flexible than the (outdated) HTML method (more on that below). Using CSS, you can set the background properties of any HTML element. Plus you can do things like, specify an image's position, whether it should repeat, how it should repeat etc.
Background Color
You can set the background color of any HTML element using the
background-color
property. You can choose a background color with the HTML color chart.HTML background code is limited, CSS background code is much better!
<div style="background-color:yellow;border:1px solid black;padding:10px;">
<p>HTML background code is limited, CSS background code is much better!</p>
</div>
0 comments:
Post a Comment