October 3rd, 2009
The content are of a box can be given width, height, and color. Width and height can be specified in points (equal to 1/72 of an inch), picas (equal to 12 points), pixels, ems, exes, millimeters, centimeters, inches, or percents.
p { width: 100pt ;}
p { width: 20pc;}
p { width: 300px;}
p { width: 40em;}
p { width: 50ex;}
p { width: 600mm;}
p { width: 8in;}
p { width: 50%;}
The color property can be used to style the text color Read More...
Tags: class, color, content, CSS, How To, id, padding, selectors, Tutorials, width
Posted in CSS Box Model |
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 12th, 2009
Some older browsers, such as Netscape Navigator 4 and IE 4, have poor support for CSS. It is possible to hide styles from these browsers using specific media types and @import rules.
All styles will be hidden from Netscape Navigator 4 by changing the link element's media type from screen to screen, projection Read More...
Tags: class, combine, CSS, hide, How To, padding, style, Tutorials
Posted in CSS Applying Styles |
1 Comment »
August 6th, 2009
Child selectors
Child selectors are used to selected an element that is a direct child of another elements parent. Child selectors will not selected all descendants, only direct children. For example, you might want to target an <em> that is a direct child of a <div>, but not other <em> elements that are descendants of the <div>
*Child selectors are not supported by IE 5, 5 Read More...
Tags: adjacent, attributes, child, class, CSS, How To, id, pseudo, Pseudo-classes, Pseudo-elements, selector, selectors, Tutorials
Posted in CSS Selectors |
1 Comment »
August 5th, 2009
Should you use id or class? Classes can be used as many times as needed within a document. IDs can only be applied once within a document. If you need to use the same selector more then once, classes are a better choice.
However, IDs have more weight then classes. If a class selector and ID selector apply the same property to one element, the ID selector's value would be chosen.
Tags: better, class, CSS, How To, id
Posted in Understanding CSS |
No Comments »
August 4th, 2009
Selectors are one of the most important aspects of CSS because they are used to "select" elements on an HTML page so the can be styled.
Sample HTML
<body>
<div id="content">
<h1> Heading Here </h1>
<p> Lorem ipsum dolor sit amet. </p>
<p>Lorem ipsum dolor <a href="#">sit</a> amet Read More...
Tags: class, id, type
Posted in CSS Selectors |
No Comments »