Hello World

Hello World

Hello World

Hello World

Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.

Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.

My First CSS Example

This is a paragraph.

Hello World!

This paragraph is not affected by the style.

Hello World!

This paragraph is not affected by the style.

Red and center-aligned heading

Red and center-aligned paragraph.

Hello world!

Every element on the page will be affected by the style.

Me too!

And me!

Same as color name "Tomato":

rgb(255, 99, 71)

#ff6347

hsl(9, 100%, 64%)

Same as color name "Tomato", but 50% transparent:

rgba(255, 99, 71, 0.5)

hsla(9, 100%, 64%, 0.5)

In addition to the predefined color names, colors can be specified using RGB, HEX, HSL, or even transparent colors using RGBA or HSLA color values.

Shades of gray

By using equal values for red, green, and blue, you will get different shades of gray:

rgb(60, 60, 60)

rgb(90, 90, 90)

rgb(120, 120, 120)

rgb(180, 180, 180)

rgb(210, 210, 210)

rgb(240, 240, 240)

The border-style Property

This property specifies what kind of border to display:

A dotted border.

A dashed border.

A solid border.

A double border.

A groove border.

A ridge border.

An inset border.

An outset border.

No border.

A mixed border.

CSS 3-digit Hex Code

This is a paragraph.

The border-width Property

This property specifies the width of the four borders:

Some text.

Some text.

Some text.

Some text.

Some text.

Some text.

Note: The "border-width" property does not work if it is used alone. Always specify the "border-style" property to set the borders first.

The border-color Property

This property specifies the color of the four borders:

A solid red border

A solid green border

A dotted blue border

Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.

CSS Margins

This element has a margin of 70px.

Using individual margin properties

This div element has a top margin of 100px, a right margin of 150px, a bottom margin of 100px, and a left margin of 80px.

Using the text-transform property

This text is transformed to uppercase.

This text is transformed to lowercase.

This text is capitalized.

Text-shadow effect!

CSS font-family

This is a paragraph, shown in the Times New Roman font.

This is a paragraph, shown in the Arial font.

This is a paragraph, shown in the Lucida Console font.

CSS Fallback Fonts

This is a paragraph.

This is another paragraph.

The font-style property

This is a paragraph in normal style.

This is a paragraph in italic style.

This is a paragraph in oblique style.

The font-weight property

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is a paragraph.

This is heading 1

This is heading 2

This is a paragraph.

Specifying the font-size in percent and em displays the same size in all major browsers, and allows all browsers to resize the text!