Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Another problem with border-bottom-style (works in Firefox, not in IE7 1

Status
Not open for further replies.

Gert74

Technical User
Jan 26, 2001
48
0
0
NL
Hi,

Since I was helped so well with my last question, I'm hoping to solve this problem too with a little help. My mane navigation is coded like this (html):
Code:
	<div id="header">
             <ul>
              <li>home</li>
              <li><a href="/portfolio.php">portfolio</a></li>
              <li><a href="/over-mij.php">over mij</a></li>
              <li><a href="/werkwijze.php">werkwijze</a></li>
              <li><a href="/prijzen.php">prijzen</a></li>
              <li><a href="/contact.php">contact</a></li>
          </ul>
    </div>

The relevant styles in the stylesheet:
Code:
		#header ul {margin-left:490px;}
		#header li {float:left;color:#FFFFFF;list-style:none;font-size:14px;margin-right:10px;margin-top:115px;font-weight:bold;}
		#header li a {color:#FFFFFF;text-decoration:none;border-bottom-style:dotted; border-bottom-width:1px; border-bottom-color:#FFFFFF;}
		#header li a:hover {color:#FFFFFF;text-decoration:none;border-bottom-style:solid; border-bottom-width:1px; border-bottom-color:#FFFFFF;}

A dotted underline is visible in Firefox but isn't in IE7. Any thoughts?

Gert

Gert
 
internet explorer is a bitch i hate it lol...

your code looks fine to me

have you tried it using blocked names for colors...

like...

{border-bottom: 1px dotted white;}
 
I just tried blocked names for colors, but no luck :-(

Someone else maybe.

Just to be complete, the header-div is surrounded by a div called wrapper.


Gert
 
Not sure if you have this solved yet or not, but here was the problem. Anchors are inline elements, so in IE they can't have borders. To solve that, we give the anchor tags display:block, and float them left.

Code:
<style type="text/css">
#header ul {
   margin-left:490px;
}

#header ul li {
   float:left;
   color:#FFFFFF;
   list-style:none;font-size:14px;
   margin-right:10px;
   margin-top:115px;
   font-weight:bold;
}

#header ul li a {
   display:block; 
   float:left;
   text-decoration:none;
   color:#FFFFFF; 
   border-bottom-style:dotted; 
   border-bottom-width:1px; 
   border-bottom-color:#FFFFFF;
}

#header ul li a:hover {
   color:#FFFFFF;
   text-decoration:none;
   border-bottom-style:solid; 
   border-bottom-width:1px; 
   border-bottom-color:#FFFFFF;
}

</style>

[monkey][snake] <.
 
Anchors are inline elements, so in IE they can't have borders.

Huh? I get borders on links in IE 6 on:w3C tryit css_text-decoration

using:
Code:
<html>
<head>
<style type="text/css">
h1 {text-decoration: overline}
h2 {text-decoration: line-through}
h3 {text-decoration: underline}
a {text-decoration: none;
border-bottom: 1px dotted black;}
</style>
</head>

<body>
<h1>This is header 1</h1>
<h2>This is header 2</h2>
<h3>This is header 3</h3>
<p>Testing <a href="[URL unfurl="true"]http://www.w3schools.com/default.asp">This[/URL] is a link</a> links</p>
</body>

</html>

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
@monksnake: I do not fully inderstand why the same kind of code already worked within another div, but you solved my problem. Thank you very much!

Gert
 
me said:
Anchors are inline elements, so in IE they can't have borders.

Apparently that isn't true. Let me rephrase.

For some reason, anchors within unordered lists don't show borders when the list items are floated.

Here is a test.

I'm sorry I misfed information, truth is I don't know what the hell IE ever does, perhaps I said that because I generalized a situation.

Code:
<html>
<head>
<style type="text/css">
a {
text-decoration: none;

border-bottom: 1px solid black;
}

li {float:left}
</style>
</head>
<ul>
<li>
<a href="[URL unfurl="true"]http://www.w3schools.com/default.asp">This[/URL] is a link</a> 
</li>
</ul>
</html>


And @Gert: [cheers]

[monkey][snake] <.
 
It has to do with the default padding differences between browsers for the <li> tag. To see what I mean, try:
Code:
<html>
<head>
<style type="text/css">
a {
text-decoration: none;

border-bottom: 1px solid black;
}
li {float:left ; [COLOR=blue][b]padding-bottom: 1px;[/b][/color] }
</style>
</head>
<ul>
<li>
<a href="[URL unfurl="true"]http://www.w3schools.com/default.asp">This[/URL] is a link</a> 
</li>
</ul>
</html>

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top