Home arrow Style Sheets arrow CSS: Crossing the Border

CSS: Crossing the Border

In our previous tutorials we discussed working with text and fonts in your cascading style sheets. Here, we will discuss working with the various border properties. There are a lot of ways to manipulate them, so let's dive right in.

Author Info:
By: James Payne
Rating: 5 stars5 stars5 stars5 stars5 stars / 8
March 24, 2008
  1. · CSS: Crossing the Border
  2. · Setting Different Borders Around An Element
  3. · How to Set the Border Width
  4. · How to Set Border Colors

print this article

CSS: Crossing the Border
(Page 1 of 4 )

In HTML borders usually pertain to tables. In CSS however, we can add borders to any element. In this way we can manipulate the style and color of our elements to give them a more aesthetically pleasing look.

Setting the Border Property

To begin with, let's create a border around some text, which will have the same type of border on all sides:



<style type="text/css">



border: thick dotted rgb(150,0,00);

text-align: center


p.solid {border-style: solid; }

p.double {border-style: double; }

p.groove {border-style: groove; }

p.dotted {border-style: dotted; }

p.dashed {border-style: dashed; }

p.inset {border-style: inset; }

p.outset {border-style: outset; }

p.ridge {border-style: ridge; }

p.hidden {border-style: hidden; }




<p>Welcome To Ed's Over-All Emporium! YEE-HAW!</p>

<p class="solid">WOO-EE!</p>

<p class="double">Come N Git It!</p>

<p class="groove">My other bass is a big-mouth!</p>

<p class="dotted">I Love My Gun Rack</p>

<p class="dashed">Deodorant is for wimps</p>

<p class="inset">I met my wife at a family reunion</p>

<p class="outset">Chuck Norris is a real American</p>

<p class="ridge">My family tree is a Christmas wreath</p>

<p class="hidden">I didn't just plead the fifth...I drank it</p>



Go ahead and try it out to see what the different border styles look like.

blog comments powered by Disqus

- CSS Padding Overview
- CSS: Margins Overview
- Top CSS3 Button Tutorials
- More Top CSS3 Tutorials for Animation and Im...
- CSS Mega Menus: Adding Extra Sections
- CSS Mega Menus
- CSS3 Accordian Menu: Horizontally Display Hy...
- CSS Combinators: Working with Child Combinat...
- CSS Combinators: Using General Siblings
- Intro to CSS Combinators
- CSS Semicircles and Web Page Headers
- Drawing Circular Shapes with CSS3 and Border...
- More CSS Pagination Link Templates
- CSS Pagination Links
- Animated CSS3 Image Gallery: Advanced Transi...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials