Percentage values refer to the width of the parent element.

As you can see, this property accepts any length value or apercentage. That's all. So if you want allH1 elements to have 10 pixels of padding on allsides, it's this easy, as the result shown in Figure 7-56 makes clear:

H1 {padding: 10px; background-color: silver;}
Figure 7-56

Figure 7-56. Padding applied to an H1 element

game download games video avi Saturday 28th of January 2012 04:39:16 AM

CSS Tutorials

CSS Tutorials

Welcome to the CSS Tutorials. In this section we cover Cascading Style Sheets, the powerful supplement to HTML that allows you complete control over the look of your websites. We'll show you how to create Cascading Style Sheets, and some of the cool tricks you can achieve with them.

For Beginners...

Introduction to CSS
This tutorial covers the basics: what are style sheets? How do I make a style sheet? It also shows some of the cool things you can do with style sheets.

CSS Units
A description of all the units that can be used with CSS, including lengths, percentages, colours and URL's.

For Intermediate Users...

Controlling Background Images and Colours
Learn how to use CSS properties to add background images and colour to your Web pages. Lots of neat tricks and examples are included!

Controlling Fonts with CSS
In this tutorial we take a look at how to control the fonts used in your page body text, using the various font properties that can be controlled with style sheets.

Controlling Text Appearance with CSS
This tutorial shows you how to control the layout of your text using the text properties available in CSS, such as line spacing and text alignment.

Making Lists Look Nicer with CSS
You can really go to town with HTML lists when you add a sprinkle of CSS! This tutorial shows you how to make your lists stand out from the crowd.

For Advanced Users...

CSS Positioning
This tutorial teaches you how to use CSS to position images, text, and other elements on your Web pages. Essential reading for anyone who wants to start using CSS for layout.




on how this kind of selector works.

WARNING

Navigator 4 does not apply colors to form elements, but setting thecolors for form elements does work in Internet Explorer 4 and 5, andOpera 3.5 and later.

space is still there because the element is still part of thedocument's layout. We just can't see it.

Note too that it's possible to set the descendant element of ahidden element to be visible.This would cause the element to appear wherever it normally would,despite the fact that the ancestor (and possibly the siblings) isinvisible. In order to do so, you would need to explicitly declarethe descendant element to be visible, sincevisibility is inherited. Thus:should be affected by the property, although not all user agents cando this correctly. Also,background-color is not inherited. Its defaultvalue istransparent,which makes sense; if an element doesn't have a defined color,then its background should be transparent so that the background ofits ancestor elements will be visible. Imagine for a moment that the