Thursday 28th of August 2008 08:08:59 PM

Nice and Free CSS Templates

This site contains free css templates for your website - Just copy and paste and there you have a stunning website !

the negative is added to the positive -- and the resulting value is the distance between the elements. Figure 8-21 provides two concrete examples.

Figure 8-21

Figure 8-21. Examples of negative vertical margins

You'll notice the "pulling" effect of negative top and bottom margins. This is really no different from the way in which negative horizontal margins cause an element to push outside of its parent. Consider:

Menu und content
dynamic

Menu fixed, content
dynamic

Menu und content
dynamic

3 columns all
dynamic

4 columns all
dynamic

Menu floating

Menu fix, Inhalt u.
Head dynamic

3 columns fix
centered

dynamic mit
Head und Footer

fixed BOX centered

dynamic BOX
centered

fixed Box total
centered
This is text, <EM>some of which is emphasized</EM>, plus other text<BR>which is <B STYLE="font-size: 24px;">boldfaced</B>and <SPAN STYLE="vertical-align: top; line-height: 18px;">tall</SPAN>and which is<BR>larger than the surrounding text.</P>

Since we've given the "tall" text aline-height of 18px , thedifference between font-size andline-height is 6 pixels. In this case, though, the line's height (or the height of the line box) is determined by the height of its constituent elements and other content (such as text). It's important to understand that line-height really only applies to inline elements and other inline content and not to block-level elements. We can set a line-height value for a block-level element, but the only way this will have any visual impact is by being applied to inline content within that block-level element. Consider the following paragraph, for example:which is the Bold face and which has a numerical weight of700. Figure 5-11 shows us thevisual result of all this.

Figure 5-11

Figure 5-11. Greater weight will usually confer visual boldness

Let's take this all one step further, and add two more rules,plus some markup, to illustrate how all this works (see Figure 5-12 for the results):

/*   assume only two faces for this example: 'Regular' and 'Bold'   */P {font-weight: 100;}   /* looks the same as 'normal' text */

If both margins are set explicitly, and width is auto, then the value of width will be set to be whatever is needed to reach the required total (that is, the content width of the parent element). The following markup is displayed as shown in Figure 8-13:

P {margin-left: 100px; margin-right: 100px; width: auto;}
Figure 8-13

Figure 8-13. Automatic width

shows the following declaration, which uses clear to prevent H2 elements from flowing past floated elements to the left side:

H2 {clear: left;}
Figure 7-74

Figure 7-74. Clear to the left

However, this will allow floated elements to appear on the right side of H2 elements, as shown in Figure 7-75.

Figure 7-75

Figure 7-75. Clear to the left, but not the right