PHP tutorials, html tutorial, photoshop tutorial, ajax tutorials,java tutorial, web design tips tutorials, css tutorial, visual basic tutorial, dreamweaver tutorial, php tutorial, html tutorials, c++ tutorial, javascript tutorial, windows tutorials, free flash tutorials, free photoshop source codes, sql tutorial
Web Development Tutorials, Programming Tutorials, PHP Script Index
Home | Forums | Downloads | Books | Submit Content | Links

Programming Articles

  PHP articles
  MySql articles
  Visual Basic.Net articles
  Java articles
  ASP articles
  ASP.Net articles
  Visual Basic articles
  CSS articles

Programming Tutorials

  PHP tutorials
  MySql tutorials
  Visual Basic.Net tutorials
  Java tutorials
  ASP tutorials
  ASP.Net tutorials
  Visual Basic tutorials
  HTML tutorials
  CSS tutorials

Programming Source Codes

  PHP scripts
  Visual Basic.Net scripts
  JavaScript scripts
  ASP scripts
  ASP.Net scripts
  Visual Basic scripts

Our Partners

  Free Resources
  Publisherbank
  Free Link Directory
  PHP Magazine
  Webmaster Passion
  Search Engine Bank
  Free Directory Site
  Free PHP Scripts
  Links Shopping Mart
  Variety Bazar
  Urdu Office Tutorials
  Evernew Scripts
  Evernew Scripts
  Evernew Directory
  Our Achievements
  Web templates
  Buy and Sell Templates
  Text Link Traders
  Directory Metro
  Gifts Choice
  Valentines Ecards
  Template Directory

Working with Backgrounds

Date:2006-06-27

In this tutorial, you will learn about background properties and its usage, following background properties are used in CSS

  • background-color
  • background-image
  • background-repeat
  • background-attachment
  • background-position

background-color
Using background-color property you can change background colour for an HTML element. For example:

p{

background-color:red;

}

body{

background-color:00ffcc;

}

 

background-image
Using background-image property you can change background image. For example:

p{

background-image:url(images/bg.gif);

}

body{

background-image:url(images/bg1.gif);

}

background-repeat
Valid values are: repeat, repeat-x, repeat-y, and no-repeat. A value of repeat, repeats the background horizontally and vertically. repeat-x only repeats the background in the horizontal direction, repeat-y vertical direction. And as you might have thought no-repeat does not repeat the background at all.

Code

Description

background-repeat: repeat

This is the default setting. Tiles the image both horizontally and vertically.

background-repeat: repeat-x

Tiles the image in the horizontal direction only. Good if you want the background running across the top of the page.

background-repeat: repeat-y

Tiles the image in the vertical direction only. Great for left-hand page borders!

background-repeat: no-repeat

No repeating takes place; only one copy of the image is displayed. This is good if you want to use a big image that isn't designed to tile.

background-attachment
There are two values for background-attachment, scroll and fixed. A valid you of scroll is what is common with browsers today. The background scrolls along as you do. A value of fixed will keep the background fixed, with the text and other goodies scrolling on top of it.

background-position
Background positioning is done by entering a value for the left position and top position separated by a space.

Setting multiple background values










Desclaimer | Privacy Policy | Submit Content | Links | Link to Us | Sitemap |Contact Us
Copyright Programming Tutorials, Web Development Tutorials, Source codes © All Rights are Reserved.
Powered By Evernew Solutions

Flights - Car Insurance - Loans - Credit Cards