tags:

views:

68

answers:

2

I am trying to add a bottom border to a div

.divLast
{
   top: 0px;
   margin:0px;  
   padding: 0px 2px 2px 3px;    
   border-width: 2px;
   border-bottom-width:2px;
   border-bottom-color:White;
   width: 100%;
}

However the bottom border does not appear white. Any idea?

+6  A: 

You have to specify the border-bottom-style also to the div

and your code becomes

.divLast 
{
   top: 0px;
   margin:0px;  
   padding: 0px 2px 2px 3px;    
   border-width: 2px;
   border-bottom-width:2px;
   border-bottom-color:White;
   border-bottom-style: solid;
   width: 100%;
}

or you can use a shorthand for the border-bottom like below

<style>
.divLast 
{
   top: 0px;
   margin:0px;  
   padding: 0px 2px 2px 3px;    
   border-width: 2px;
   border-bottom: 2px white solid;
   width: 100%;
}
</style>
<div class='divLast'>
   test element with white border bottom
</div>

This works fine for me

rahul
thank you for the best advice
ScG
+1  A: 

It's because you need to state what the border style is. Without this the border wont show:

border-bottom-style:solid;

You could also combine your declerations into one like so:

border-bottom:2px solid White;
Jamie Dixon