Border style problem

admin

Administrator
Staff member
What is the problem here? Why don't I get a bottom border in IE 6 ?

<html>

<head>

<style type="text/css">
<!--

.yellow {
background-color: #FFCC00;
border-top-width: 0px; border-bottom-width: 1px; border-left-width: 0px; border-right-width: 0px
}
-->
</style>

</head>

<body>

<div align="center" class="yellow"><br>How to Write Effective Links<br><br></div>

</body>
</html>

Thx for any help.<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<style type="text/css">
<!--
.yellow {
background-color: #FFCC00;
border: 0px;
border-bottom: 1px solid #000;
}
-->
</style>
</head>
<body>
<div align="center" class="yellow"><br>How to Write Effective Links<br><br></div>
</body>
</html>Dave,
Thanks!
I guess that first it is necessary to specify that an element has a border before one can style the border.
Thanks againNo; you have to set all necessary border properties to get a border. In your first example, you omitted setting the border style, which defaults to "none", hence no border.

The problem with shorthand properties is that often it is thought that not specifying a property will not effect that property, while in reality it is set, but to its default value.

To achieve to effect you look for, there's a number of ways that have the same effect; dave gave you a shorthand version that will first set the whole border off, and then specifies the necessary values for just the bottom border properties (width, style, color).Thanks Ronald,
I'm learning what I thought I already knew.
 
Back
Top