|
CSS Home
CSS TutorialIntroductionCSS Advantages CSS Syntax Implementing CSS CSS Class CSS ID CSS Font CSS Text CSS Background Code CSS Border CSS Margin CSS Padding CSS Lists CSS Height & Width CSS Positioning CSS Float CSS Layers CSS Summary CSS CodesCSS AlignCSS bgcolor CSS Cellpadding CSS Cellspacing CSS Floating Menu CSS Hyperlinks CSS Leading Inline Style Sheets Embedded Style Sheets External Style Sheets CSS Scrollbars CSS Table Width CSS Print Version CSS Table-layout CSS ExamplesCSS ExamplesCSS Table-layout Example CSS ReferenceCSS Mini TutorialCSS Properties CSS Color Codes CSS Template CSS Media Types FREE Hosting!With every domain name you register with ZappyHost, you get FREE hosting.$1.99 Domain NamesWith every new non-domain purchase thru ZappyHost, you get a domain name for only $1.99. |
CSS BorderThe following CSS border codes demonstrate the various CSS properties you can use to apply styles to the border of any HTML element. CSS allows you to set styles for the border of any HTML element. It also provides you with a way of setting border styles for one or more sides of an element. Setting Borders on all SidesTo set border styles for all sides of an element, you use the border-width, border-style, and border-color properties. You can also use the border property to set all properties at once. 'border-width', 'border-style', and 'border-color'
<p style="border-width:1px;border-style:solid;border-color:blue;">This text has border styles applied using the border-width, border-style, and border-color properties.</p>
This results in: This text has border styles applied using the border-width, border-style, and border-color properties. The 'border' PropertyThe 'border' property is shorthand for setting border-width, border-style, and border-color.
<p style="border:1px solid blue;">This text has border styles applied using the border property.</p>
This results in: This text has border styles applied using the border property. Border StylesBorders can have the following styles.
This results in: This text has a border style of 'solid'. This text has a border style of 'dotted'. This text has a border style of 'dashed'. This text has a border style of 'double'. This text has a border style of 'groove'. This text has a border style of 'ridge'. This text has a border style of 'inset'. This text has a border style of 'outset'. Setting Borders for Each SideIf you don't want the border settings to be applied to all four sides, or if you want each side to have different styles applied, you can use the following properties: Explicit Properties
Example:
<p style="border-bottom-width:4px;border-bottom-style:double;border-bottom-color:blue;">This text has a bottom border.</p>
This results in: This text has a bottom border. Shorthand PropertiesThe following properties provide you with a more concise way of specifying border properties for each side.
Example:
<p style="border-bottom:4px double blue;">This text has a bottom border.</p>
This results in: This text has a bottom border. Enjoy this website?
Oh, and thank you for supporting Quackit! |
Need Content for your Website?Get unique, quality digital content for your website. You can even earn money by reselling it!Includes:
|