|
HTML Home
HTML TutorialHTML Tutorial HomeAbout HTML Getting Started HTML Elements HTML Formatting HTML Attributes HTML Colors HTML Links HTML Images HTML Meta Tags HTML Comments HTML Forms HTML Tables HTML Image Maps HTML Frames HTML Entities HTML Layouts HTML Styles HTML Scripts HTML Website Templates Website Hosting Summary HTML Code GeneratorsHTML Code GeneratorHTML Table Generator Marquee Generator Music Code Generator HTML Text Generator Text Box Generator Free HTML CodesHTML Background CodeHTML Comment Box Codes HTML Font Codes HTML Picture Codes HTML Marquee Code HTML Music Codes More Codes... HTML ReferenceComplete HTML Tag ListHTML Special Characters Hex Color Codes HTML Help |
HTML Background CodeThis article provides HTML background code - code for setting the background properties of an HTML element. HTML Background Code (deprecated)HTML is very limited for setting backgrounds. You can only specify a background image on the To set the background properties for your page in HTML, do something like this:
<body background="/images/image_name.gif" bgcolor="orange">
The HTML background code is deprecated (i.e. not recommended), so you're better off using CSS to set background properties. The CSS Method (recommended)CSS provides you with more options for setting your background. You can set background properties on any element, plus you can do things like, specify an image's position, whether it should repeat, how it should repeat etc. Background ColorYou can set the background color of any HTML element using the
This results in:
HTML background code is limited, CSS background code is much better!
Background ImageYou can set a background image like this:
This results in:
HTML background code is limited, CSS background code is much better!
Fixed Background ImageYou can fix the position of a background image so that its position is fixed even if it's containing block scrolls. You do this with the
This results in:
HTML background code is limited, CSS background code is much better!
example shows how a background image can be set to a fixed position
- even though its containing block scrolls.
Shorthand Background CodeCSS provides the following properties for setting the background on HTML elements: background-attachment, background-color, background-image, background-position, background-repeat. You can use the CSS
HTML background code is limited, CSS background code is much better!
example shows how a background image can be set to a fixed position
- even though its containing block scrolls.
Enjoy this website?
Oh, and thank you for supporting Quackit! |
FREE Hosting!With every domain name you register with ZappyHost, you get FREE (ad supported) hosting.PLUS you get:
Featured Template:
(Build your websites in minutes!) Got a MySpace Page?Get "www.yourname.com" for your MySpace page. Learn how >>. |