Css Course


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.


CSS outline-color

The outline-color property sets the color of an outline.

- Values: - Syntax:
outline-color: value;

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


CSS outline-style

The outline-style property specifies what kind of line to display. You can define one of the fallowing values.

none, solid, dashed, dotted, double, groove, ridge, inset, outset
- none specifies no outline. In the image below you can see the effect of the other values:
css outline-style - Syntax:
outline-style: value;

CSS outline-width

The outline-width sets the size of the border.
- Values: - Syntax:
outline-width: value;
Example:
<style>
#idd {
outline-style: dashed;
outline-width: 2px;
outline-color: blue;
padding:3px;
}
</style>

<h4>Example CSS outline</h4>
 <div id='idd'>Free Web Development courses and resources.</div>

outline shorthand

Using the CSS outline shorthand property you can shorten the code. It accept three values representing outline-width, outline-style, and outline-color.
- Syntax:
selector { outline: width_val style_val color_val; }
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

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
CSS Outline

Last accessed pages

  1. Add, Change, and Remove Attributes with jQuery (46356)
  2. Node.js Move and Copy file (28419)
  3. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (141747)
  4. Rectangle, Oval, Polygon - Star (3322)
  5. PHP PDO - prepare and execute (9187)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (471)
  2. CSS cursor property - Custom Cursors (78)
  3. The Mastery of Love (69)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (62)
  5. CSS3 2D transforms (46)