CSS Background CSS And Html - SetFlix - The Latest Online Tools
Responsive Ads Here

Post Top Ad

Your Ad Spot

Friday, 14 February 2020

CSS Background CSS And Html

CSS Background CSS And Html

CSS Background CSS And Html


The background-color property specifies the background color of an item.

The background color of a page is defined like this:


background color



With CSS, a color is often referred to as:

A valid color name - such as "red"
A HEX value - such as "#ff0000"
An RGB value - "RGB (255,0,0)"

See the CSS color values for the complete list of possible color values.

In the example below, <h1>, <p>, and <div> elements have different background color:
CSS background-color example


Background image 
Background-image property specifies an image to be used as a component background. 
By default, the image is repeated so that it covers the whole element. 
Background images for a page can be set:image as the background



Background image - Set position and no repetition

Background image is only shown by background-repeat property once shown:



In the above example, the background image is shown at the same place as the text. We want to change the location of the image, so that it does not make much trouble to the text.

Background location of image position is specified by property:




Background image - Fixed position

To specify the background image should be specified (do not scroll with the rest of the page), use the background-attachment property:




No comments:

Post a Comment

Post Top Ad

Your Ad Spot