Formatting Structure w/CSS3



index
Disabled back button Next Section
printable version

Section 1: Structural Tags

CSS Properties for Structural Tags

In the previous CSS notes we discussed several properties with respect to images and text alignment that also apply to structural tags.

You can see the effect of the styles on the aside to the – wait for it – side!

Section 2: Demos

Demo Page #1

The first demo page includes a header, footer, and a section with two articles side-by-side.

Demo Page #2

The second demo page is rather elaborate.

The second demo page has several excellent links, but here are a few more.

Section 3: Box Model

Recall that each element in an HTML page defines a rectangular region, or box, that the browser uses to place the element in the browser window.

The following diagram shows the properties that make up the box model and how they relate to each other:

CSS Box Model.

To calculate the height of a box when using the box model, you add the height of the content area to the sum of the heights of the top and bottom borders, top and bottom margins, and top and bottom padding.

Here is a good explanation of The CSS Box Model.

Section 4: Positioning

In CSS, each of these boxes has a position in three dimensions: height, width, and depth.

A discussion of relative, absolute, and fixed positioning will be deferred until a later set of notes.

Normal Flow

Normal flow is the default scheme used for positioning, but can be specified using position: static.

Relative positioning changes the position of the HTML element relative to where it normally appears.

Float

Float was covered in the Intermediate CSS notes.

More float notes:

Section 5: Overflow

This property specifies the behavior that occurs when an element's content overflows the element's box.

The CSS3 basic box model module adds to this by allowing the content to be clipped on just one axis.

text-overflow

CSS3 also provides a text-overflow property so that when an element overflows its box and gets clipped, there is a visual 'hint' to the user that the text has been clipped, commonly the ellipsis: "…"”.

text-overflow comes into play only when:

Here are some examples:

Section 6: Let's Play

Click the "Edit and Click Me >>" to see the results of the html code in the left panel in the panel on the right.

Then, play around with the html code, making changes and seeing the effect of those changes in the right panel.