CSS Outlines

CSS Outlines

Outlines are very similar to the borders but there are few major differences in borders and outlines:

An outline does not take up space.

Outlines do not have to be rectangular.

Outline is always the same on all sides; you cannot specify different values for different sides of the element.

NOTE: The outline properties are not supported by IE 6 or Netscape 7.

You can set following outline properties using CSS.

The outline-width property is used to set the width of the outline.

The outline-style property is used to set the line style for the outline.

The outline-color property is used to set the color of the outline.

The outline property is used to set all the above three properties in a single statement.

The outline-width Property:

The outline-width property specifies the width of the outline to be added to the box. Its value should be a length or one of the values thin, medium, or thick . just like the border-width attribute

A width of zero pixels means no outline.

Here is the example:

<p style="outline-width:thin;outline-style:solid;">

This text is having thin outline.

</p>

<br />

<p style="outline-width:thick;outline-style:solid;">

This text is having thick outline.

</p>

<br />

<p style="outline-width:5px; outline-style:solid;">

This text is having 5x outline.

</p>

 

ليست هناك تعليقات:

إرسال تعليق