Outlines are special visual properties similar to border, but take up no space in the layout. They will highlight an item without shifting its position.
An outline is a line that is drawn around elements, outside the border edge, to make the element "stand out". It specifies the style, color, and width of an outline, but don't have separate definitions for each of the four sides.


The outline-color property sets the color of an outline.
  - Values:   - Syntax:

The "outline-color" does not work if it is used alone. You need to define the "outline-style" property before the "outline-color".


The outline-style property specifies what kind of line to display. You can define one of the fallowing values: - none specifies no outline. In the image below you can see the effect of the other values:
css outline-style
  - Syntax:


The outline-width sets the size of the border.
  - Values:   - Syntax:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <style type="text/css"><!--
 #idd {
  outline-style: dashed;
  outline-width: 2px;
  outline-color: blue;
 <div id="idd">Free Web Development courses and resources.</div>
  - Result:
Free Web Development courses and resources

outline shorthand

Using the outline shorthand property you can shorten the code. It accept three values representing outline-width, outline-style, and outline-color.
  - Syntax:
The CSS code from the above example can be rewritten like this (the effect is the same):
#idd { outline: 2px dashed blue; }

Daily Test with Code Example

Which tag adds a new line into a paragraph?
<b> <br> <p>
First line ...<br>
Other line...
Which CSS property can be used to add space between letters?
text-size word-spacing letter-spacing
#id {
  letter-spacing: 2px;
What JavaScript function can be used to get access to HTML element with a specified ID?
getElementById() getElementsByTagName() createElement()
var elm = document.getElementById("theID");
var content = elm.innerHTML;
Click on the "echo" correct instruction.
echo "CoursesWeb.net" echo "CoursesWeb.net"; echo ""CoursesWeb.net";
echo "Address URL: http://CoursesWeb.net";
CSS Outline

Last accessed pages

  1. PHP PDO - prepare and execute (5949)
  2. Lightning Break (833)
  3. Insert, Select and Update NULL value in MySQL (24506)
  4. PHP Unzipper - Extract Zip, Rar Archives (1038)
  5. Node.js Move and Copy Directory (579)

Popular pages this month

  1. Qwop (3957)
  2. Flash Games - Free online Games (2036)
  3. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (1786)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (1778)
  5. Drag Racer V3 (1713)