Home arrow Style Sheets arrow CSS: Crossing the Border
STYLE SHEETS

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
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

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:


<html>

<head>

<style type="text/css">

p

{

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; }

</style>

</head>

<body>

<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>

</body>

</html>

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


blog comments powered by Disqus
STYLE SHEETS ARTICLES

- 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 
Support 

Developer Shed Affiliates

 




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