CSS Border

CSS Borders are extremely powerful tools for decorating your HTML elements. Let’s begin with a very simple solid border:
.my_div { border:1px solid #000; }
This will produce:

A 1px solid black border

Now let’s have a look at some of the other possibilities:
.my_div{ border:1px dotted #000; }
This will produce:

A 1px dotted black border

.my_div{ border:1px dashed #000; }
This will produce:

A 1px dashed black border

.my_div{ border:1px double #000; }
This will produce:

A 1px double-solid black border

You can also use CSS Borders to create 3D effects:
.my_div{ border:5px groove #000; }
This will produce:

A 5px groove border

.my_div{ border:5px ridged #000; }
This will produce:

A 5px ridged border

.my_div{ border:5px inset #000; }
This will produce:

A 5px inset border

.my_div{ border:5px outset #000; }
This will produce:

A 5px outset border

The 3D borders can all be manipulated using the border-color attribute

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • email
  • FriendFeed
  • LinkedIn
  • Live
  • MSN Reporter
  • MySpace
  • PDF
  • Ping.fm
  • Posterous
  • Reddit
  • RSS
  • Slashdot
  • StumbleUpon
  • Suggest to Techmeme via Twitter
  • Technorati
  • Tumblr
  • Twitter
  • Yahoo! Bookmarks
  • Yahoo! Buzz
This entry was posted on Saturday, January 16th, 2010 at 8:24 pm and is filed under CSS Tutorials. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

1 Comment

  1. CSS Outline - CSS Tutorials and CSS Articles says:

    [...] Outline January 16, 2010 – Posted by CSS Master A CSS Outline is extremely similar to CSS Border. A CSS Outline is simply a CSS Border outside the element. Using CSS [...]

    ... on July January 16th, 2010

Post a Comment