Home Robotics C++ Physics II AP Physics B Electronics AP Java Astronomy Independent Study Summer Session Contests  About
                                                       

CSS Versus HTML

While CSS properties can create the same types of presentation effects as HTML tags and attributes, CSS style go far beyond the somewhat restrictive aspects of HTML. The latter, however retains an important role in conveying the structure of the content.

Element

HTML

CSS

Font Face

Limited to common font faces with slight variations for families.

Limited to common font faces with slight variations for families.

Font Size

Limited to absolute sizes of 1-7 and relative sizes of +1 to +7 and -1 to -7

Virtually limitless.

Color

Standards-compliancy dictates 256 web-safe colors.

Standards-compliancy dictates 256 web-safe colors.

Font Weight

Limited to strong and em

Options include Bold, Bolder, Normal, Light, Lighter, and various numeric weight values.

Case

Not automatic conversion to uppercase or lowercase

Supports automatic conversion of uppercase and lowercase, even the ability to capitalize the first letter in the word.

Text Decoration

Supports underline and strikethrough.

Supports underline, strikethrough, and overline, and can remove underlines from links using the None property.

Link Rollovers

Not supported.

Using contextual selectors such as Hover, you can have links within the page that can change color when a user rolls over them.

Background Color and Images

Can set the background color of the page, tables, cells, and layers. Background images always tile.

Supports background color for the page, tables, cells, layers, and text. You can limit tiling to just vertically or horizontally, or you can prevent tiling entirely.

Block Formatting

Limited to non-breaking spaces, paragraph breaks, and line breaks. Text indenting is limited.

Properties exist to control word spacing, letter spacing, vertical alignments, text indenting using pixel spacing, etc.

Table Formatting

Cell padding and cell spacing must be defined for the entire table. Padding and spacing, therefore, appear around all edges of the table and cell.

They can be adjusted on each side of the table independent of other sides.

Borders

Tables, layers, images, and cells can contain simple borders. Sizes are controlled by pixel, and the color is limited depending on element type.

All elements, including text, can have borders. Border styles can be set, width can be in pixels, percentages, inches, etc. The color can be customized.

Lists

Lists are limited to bullets, squares, and Roman numerals.

All options available in HTML are relevant in CSS, including the ability to customize your own image to use with the list item and also to control the positioning of the image within the list item.

Positioning

Limited to HTML-based techniques to control placement of elements on the page

Features mimic the functionality of print design programs. Far superior to HTML.

Cursor Customization

Not supported. Can be set using JavaScript.

Can be customized to 14 different cursor types.