HTML/CSS Service

CSS background-size

Category: CSS, CSS Tutorials    |    2,356 views    |    Add a Comment  |   

 

background-size Description:

This is a CSS 3 property from the CSS 3 Working Draft. Until the draft has been finalized, there may be additional changes. For most up-to-date information, go to the W3C.

The background-size property allows you to change the size of the background image to better fit your page. It is often thought of as the background stretch property.

background-size in CSS Versions:

 

background-size Syntax:

background-size: [ [ <length> | <percentage> | auto ]{1,2} || round ]

  • length - A specific size
  • percentage - A size relative to the container element.
  • round - tells the user agent to get it close to that width or height

If you specify one value, the image stretches the same amount for width and height. Two values equal the width then the height to stretch. Read more…

Share/Save/Bookmark

 

CSS Background Tutorials

Category: CSS, CSS Tutorials    |    692 views    |    Add a Comment  |   

In this tutorial you will learn about Cascading Style Sheets (CSS), Background, Background Color, Background image, Repeating background image, Background position and Background attachment.

Background color

To set the background color of an element, use the “background-color” property.

Example:

body
{
background-color: #FF0000;
}

This sets the background color of the document to red.

Read more…

Share/Save/Bookmark

 

How to use CSS Background Properties

Category: CSS, CSS 2 Tutorial, CSS Examples    |    291 views    |    Add a Comment  |   

Background Color
The background-color property sets the background color of a targeted element.
background-color: value;
Values:
• color name
• hexadecimal number
• RGB color code
• transparent

Read more…

Share/Save/Bookmark