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 include external CSS file in web page?
<body> <script> <link>
<link href="/templ/style.css" rel="stylesheet" type="text/css" />
Which CSS property sets the text size?
font-weight text-decoration font-size
h2 {
  font-size: 1em;
}
Indicate the JavaScript property that can add HTML code into an element.
text value innerHTML
document.getElementById("someID").innerHTML = "HTML content";
Click on the function that returns the number of characters of a string in PHP.
count() strlen() stristr()
$str = "http://CoursesWeb.net/";
$nr_chr = strlen($str);
echo $nr_chr;       // 22
CSS Outline

Last accessed pages

  1. Complex Shapes with a single DIV and CSS (3692)
  2. Brush and Eraser (3274)
  3. jqPlot Charts (6206)
  4. Keep data in form fields after submitting the form (12353)
  5. PHP Script Website Mini-Traffic (7081)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (334)
  2. Read Excel file data in PHP - PhpExcelReader (128)
  3. The Four Agreements (98)
  4. PHP Unzipper - Extract Zip, Rar Archives (96)
  5. The Mastery of Love (90)