March 27th, 2010
In this CSS Tutorial, you will learn how to apply a background image to the <body> element. You will also learn how to apply the background-repeat and background-position properties. The goal is to create a gradient image that repeats down the right edge of the page.
Setting up the HTML Code
The HTML code for this tutorial will be comprised of three paragraphs of text Read More...
Tags: background-attachment, background-color, background-image, background-image property, background-position, background-repeat, CSS, div, How To, selectors
Posted in CSS Adding Background Images |
No Comments »
August 24th, 2009
Padding can be applied to the outside edges of the content area of any block level or inline element. Padding creates the space between the edge of the element and its content.
Like margins, padding can be applied to individual sides of a box.
p {padding: 10px}
h1 {padding-top:0px}
h2 {padding-right:5px}
h2 {padding-bottom:7px}
h3 {padding-left:10px}
Padding can alse be applied using a single shorthand property Read More...
Tags: class, CSS, div, h1, h2, How To, margin, padding, Tutorials
Posted in CSS Block Quote |
No Comments »
August 23rd, 2009
The background-color property sets the background color of an element.
The backgound-image property applies a background image to an element, which will appear on top of any background-color.
body {
background-color:#000
}
h1 {
background-image:url(header.png);
}
Tags: background, class, CSS, div, h1, h2, How To, image, margin, Tutorials
Posted in CSS Adding Background Images |
No Comments »
August 19th, 2009
Margins can be applied to the outside of any block level or inline element. They create space between the edge of an element and the edge of any adjacent elements.
Margins can be applied to individual sides of a box:
p { margin-top: 0;}
p { margin-right: -5px;}
p { margin-bottom: 10px;}
p { margin-left: 5px;}
Margins can also be applied using a single shorthand property Read More...
Tags: CSS, div, How To, margin, margins, style, Tutorials
Posted in CSS Box Model |
No Comments »
August 15th, 2009
Setting the Box Width
The width of an element is applied to the content area. Other measurements such as padding, border and margins are added to this width.
For example, if an element is specified with width: 200px; the content area is 200px wide. If padding, boder, or margin are applied to the same element, their measurements are added to the overall width Read More...
Tags: borders, CSS, div, How To, margin, padding, Tutorials
Posted in CSS Box Model |
No Comments »
August 4th, 2009
The <div> elements is a generic container that can be used to add structure to an HML document. Although it is a block level element, it does not add any other presentation to the content.
In many of the examples on this site the <div> element has been used to contain logical division of conent, such as navigation and footer information Read More...
Tags: CSS, div, How To
Posted in Understanding CSS |
1 Comment »
August 2nd, 2009
Margins create space between the edge of an element and the edge of any adjacent elements. Padding creates the space between the edge of the element and its content. The margin and padding shorthand properties also can be used to make CSS code more concise.
The margin property can combine margine-top, margin-right, margin-bottom, and margin-left Read More...
Tags: CSS, div, How To, margin, padding, table, Tutorials
Posted in Understanding CSS |
No Comments »
August 1st, 2009
Border properties can be converted to the shorthand border property. The <h1> element can be styled with border-width, border-style. and border-color or with a single border property.
Longhand Properties
h1, h2 {
text-align: center;
color: navy;
}
h1 {
border-width: 1px;
border-style: solid;
border-color: gray;
}
h2{
font: italic small-caps bold 100%/120% arial, helvetica, sans-serif;
}
p {
color: maroon;
font: 80% arial, helvetica, sans-serif;
}
Shorthand Border
h1, h2 {
text-align: center;
color: navy;
}
h1 {
border: 1px solid gray;
}
h2{
font: italic small-caps bold 100%/120% arial, helvetica, sans-serif;
}
p {
color: maroon;
font: 80% arial, helvetica, sans-serif;
}
Tags: borders, CSS, div, How To, inline, tables
Posted in Understanding CSS |
No Comments »