Setting the border for block elements

This should be fairly obvious but involves more than one setting. In boxmodel.html you should still have:

            
border-width:2px;
border-color:black;
border-style:solid;
        

Try changing those settings to see the effect:

You can also set the sides (colour, width, style) individually as with margins:

            
border-bottom-width:2px;            
        

If you wanted to have most borders red but the bottom one blue you need to do it in this order:

border-color:red;
border-bottom-color:blue;
        

Try it the other way around. The border-color will then override the border-bottom-color and it will not work. This is part of the reason CSS is referred to as cascading which will be explained soon.

submit to reddit Delicious Tweet