Sunday 30 May 2010

CSS Tip: Remove Part of a Border

CSS ButtonOften when working with a box thingy, you want a border on 3 sides, but not four. Normally, you would code that with something like this:



.someBoxyThing{

border-top:1pt solid black;

border-right:1pt solid black;

border-left:1pt solid black;

}




Instead of doing this, create a complete border, then eliminate one side. For example:



.someBoxyThing{

border:1pt solid black;

border-bottom:0px;

}



Now you have a three sided box with the bottom side eliminated.  Nice. Shout out to websiteoptimization.com for the tip.

No comments:

Post a Comment