Understanding Basic CSS in 6 Steps:

Sample code:

p {
text-indent: 5px;
border: 1px solid black;
clear: none;
float: left;
margin: 2px;
padding: 5px;
}

Steps:

Sample Code Explained:

The sample code modifies a paragraph <p> in HTML. The first line of this paragraph is indented on the left by 5 pixels (text-indent: 5px;). This paragraph has a thin black border around it (border: 1px solid black;). This paragraph can have other sections on either side of it (clear: none;). This paragraph is floated to the left (float: left), which means that whatever section to the right of it will wrap-around this paragraph. This paragraph is indented outside the border by 2 pixels in every direction (top, right, bottom, left) (margin: 2px;). This paragraph is indented inside the border by 5 pixels in every direction (padding: 5px;).

Result:

Once you've learned these five steps, you'll understand how basic CSS works and why particular CSS displays the way it does.

LAST UPDATED: 8/31/2010; Sitemap;
Content, images, design © Tatiana Hamboyan Harrison;
Email: taniahharrison@gmail.com, Google Voice: (443) 837-5719.