U of A University Information Technology Services
Cascading Style Sheets (CSS)The World Wide Web Consortium (W3C) defines Cascading Style Sheet (CSS) as a simple mechanism for adding styles (e.g. fonts, colors, spacing) to web documents. To read further information, visit the W3C's CSS web page. Style sheets control the manner in which HTML elements are displayed. Font color, style, size, and spacing; page backgrounds, margins, and layout; table margins, cell padding, and alignment are examples of properties that can be designated with a style sheet. Recommended CSS tutorials:
Adding a Style Sheet to a Web PageStyles can be added to web pages in four ways. The first three require insertion into the <head></head> tags of the HTML code.
Internal style sheets where the styles are defined in the code of the HTML file, as in the last two examples above, are commonly used when only one or two web pages require styles. The maximum usefulness of a style sheet, however, can be achieved by employing an external style sheet; it gives you the abilility to change the appearance and layout of all your web pages at once just by editing one single CSS document. CSS and IE7Internet Explorer 7 has many CSS bug fixes and treats Style Sheets differently than previous versions of IE and non-IE browsers. Traditionally, hacks were developed or found that allowed you to get around the differences while still using one CSS file. However, in addition to the bug fixes, the two most common hacks (often refered to as the 'child selector hack' and the 'star html hack') are now read by IE 7 and are ineffective. A way around this is to resort to adding an additional CSS file that is keyed to only be picked up by IE 7. Use the following statement directly after other style declarations in the HTML header of all of the HTML pages using your original style sheet. You can name your file whatever you like; IE7styles is only an example.
The only command you need to add is the one that fixes the previous. For example if in your main CSS file you have:
and you find that IE 7 misinterprets the margin. In the IE 7 CSS file you just need to override the margin-right command. Example:
|
http://uits.uark.edu/web/index_4772_ENG_HTML.htm
