w3reference home
CSS Tutorial


Bookmark and Share

CSS Outline

There are properties in CSS by which you can set otline of an element. An otline is a line that is drawn around the element, outside the border boundary. There is one drawback however. These properties do not work in Internet Explorer. We will discuss these properties here.

Set outline property

You can set the properties of the outline like the color, style and width by using the outline property. Example:
<html>
<head>
<style type="text/css">
p 
{
border: green solid thin;
outline: red dotted thick
}
</style>
</head>

<body>
<p>This paragraph has green border and red outline.</p>
</body>
</html>
Output:

This paragraph has green border and red outline.


Set the outline properties by using different commands

You can set the properties of the outline by using the various commands also. They are discussed below:
outline-style The style of the outline can be set by using the outline-style property. The various styles of outlines that can be used are given in Styles of the border section.
outline-color The color of the outline can be set by using the outline-color property. The color can be specified by color name, rgb number or hexadecimal number.
outline-width The width of the outline can be set by using the outline-width property. The ways to define the width of the outline are specified in Width of the border section.
The above example can also be represented by using the three commands given above. Let's see how..!!
Example:
<html>
<head>
<style type="text/css">
p.out
{
border: green solid thin;
outline-style: dotted;
outline-color: red;
outline-width: thick
}
</style>
</head>

<body>
<p class="out">This paragraph has green border and red outline.</p>
</body>
</html>
Output:

This paragraph has green border and red outline.

Code Validator
Learn FTP
Color finder
Link Checker
Free web designs
Coming soon!
Interview Questions...
'w3reference : Learn by examples ... Advanced to beginner's tutorials ...'
Ajax: AJAX tutorial1 | Apache: Apache HTTP Server | Restarting Apache | CSS: CSS Border | CSS Syntax | CSS Selector | CSS Comment | CVS: CVS Release | CVS Login | CVS Logout | CVS Annotate | Databases: Rolap Tutorial | OLAP Tutorial | OLTP Tutorial | data warehousing | Expect: HTML: html | Linux: Dot (.) conf files | Linux Mount Point | Linux Filesystem | SSH Tutorial | Linux Commands: cal | cat | cfdisk | chroot | MySQL: MySQL Commands | PHP: PHP Basics | PHP Variables | PHP Output (echo/print) | PHP String Concat | PL/SQL: PL/SQL Data Types | PL/SQL Control Structures | PL/SQL File Extensions | PL/SQL DBMS_OUTPUT package | Python: My first Python program | Shell: Starting Bash | Bash Redirection | Bash Pipes | Bash Variables | SQL: SQL Transactions | SQL Constraints | SQL Drop | SQL Union & Union All | SVN: svn architecture | SVN Repository | SVN Import | SVN Checkout | Tech: soap | Web Designing: Web Hosting | HTML/XHTML/CSS code validator | Learn FTP | Search Engine Optimization Tips | www: XML: XML vs HTML | XML Syntax | XML Tags, Elements and Attributes | XML Namespaces |
Sitemap | Disclaim | Privacy Policy | Contact | ©2007-2009 w3reference.com All Rights Reserved.