CSS - Cascading Style Sheets

An Interactive How To Code CSS Tutorial for Beginners

Our Hosting Partners:

iPage Hosting $4.25/mo
Yahoo! Hosting $7.46/mo
1&1 Hosting $6.99/mo
GreenGeeks $4.95/mo
Globat $4.44/mo

Free Domain Name
If you Order Today!

Our CSS Style topics:

Css3


CSS Code Tutorial Chapters:

  1. Introduction
  2. Basics of CSS
  3. All About Selectors
  4. Background and Color
  5. Fonts and Text
  6. Links
  7. Lists
  8. Margin
  9. Padding
  10. Border
  11. Good CSS Design
  12. Resources

visit our other tutorials:

web design tutorial
html code tutorial


Cascading Style Sheets: an Interactive Tutorial

CSS Borders and Border Styles

Chapter 10 part 2 (of 2)

So let's make each paragraph have a medium border that is dotted:

p { border-width: medium; border-style: dotted; }


So close to getting our border perfect. But what if the border to be blue? Simple. It's the border-color property. Just set it to blue:

p { border-width: medium; border-style: dotted; border-color: blue; }

Wouldn't it be nice to have a combination property? There is. It's just border:, and it expects width, style, then color. So the example immediately above could be simplified to:

p { border: medium dotted blue; }

If you want to set each of the four borders individually, you can. The properties are border-top, border-right, border-bottom, and border-left. The values expected are width, style, then color. If you wanted every paragraph with a dotted left border in red, and a dashed right border in purple, you could use:

p { border-left: dotted red; border-right: dashed purple; }

Think you understand margin, padding, and border? Try making a look-a-like to this coupon. Hint: You might want to use a width: or height: property. Guess how they work.

50% OFF
EVERYTHING
expiration date: yesterday

Click here if you get stuck or want to see how I did it.

advertisement
Our Hosting Partners:

iPage Hosting $4.25/mo
Yahoo! Hosting $7.46/mo
1&1 Hosting $6.99/mo
GreenGeeks $6.95/mo
Globat $4.44/mo

Free Domain Name If you Order Today!

Copyright © Dave Kristula. All Rights reserved.