Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
Turning off border makes text disappear??
Old 04-19-2008, 01:05 PM Turning off border makes text disappear??
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
IE7 just gets worse and worse!

I have a div that contains a list, used for navigation. In IE, if I dont use a border the div seems to turn invisible; but if I turn it on, the background colour returns and you can see it!

Even when you cant see it, you can still highlight the text.

Here is my code:

HTML:
Code:
  <div id="navContainer">
    <ul id="nav">
      <li><a href="#">home</a></li>
      <li><a href="#">reviews</a></li>
      <li><a href="#">about</a></li>
      <li><a href="#">register</a></li>
      <li><a href="#">contact</a></li>
    </ul><br class="clear" />

  </div>
CSS:
Code:
#nav {
float:left;
width:720px;
height:45px;
list-style-type:none;
padding:0;
margin:0;}

#nav li {
display:inline;}

#nav a {
float:left;
margin-left:30px;
color:#333;
text-decoration:none;
font-weight:bold;
padding:10px 0;}

#navContainer {
background:#A4A4A4 url(../image/bgNav.gif) no-repeat 0 0;
border:#000 solid 1px;}
Any ideas?!?
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
 
Register now for full access!
Old 04-19-2008, 01:09 PM Re: Turning off border makes text disappear??
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Actually Ive just realised, if I just add one other property to it [e.g. width:100%;] it seems to fix it!


?!?!?!????

Actually, it doesnt. It leaves a little gap below the div. Does anyone know what might be wrong with it? I hate Microsoft with a passion
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Last edited by pealo86; 04-19-2008 at 01:16 PM..
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 04-19-2008, 01:27 PM Re: Turning off border makes text disappear??
Webmaster Talker

Posts: 560
Trades: 0
Sounds like you are having a problem with the padding or border-spacing properties.

Matt
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
Old 04-19-2008, 02:27 PM Re: Turning off border makes text disappear??
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Its wierd, if I just specify the background attributes, then the background of the div does not appear, but the div is still there??
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 04-19-2008, 02:28 PM Re: Turning off border makes text disappear??
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
What I often to in this case, is absolutely position the ul#nav, set ul#nav li to display: block instead of display: inline, then float the 'li' element instead of the 'a' element, which makes it easy to size the 'a' element in according the the dimensions set on the 'li'. This is all very easy when doing live testing in Firebug, and is pretty much bulletproof across the spectrum of browsers.
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-19-2008, 02:32 PM Re: Turning off border makes text disappear??
Webmaster Talker

Posts: 560
Trades: 0
Try this:

#navContainer {
background-image:url(../image/bgNav.gif);
background-repeat: no-repeat;
background-color: #A4A4A4;
border:#000 solid 1px;}

Matt
__________________

Please login or register to view this content. Registration is FREE
170 Designs is offline
Reply With Quote
View Public Profile
 
Old 04-19-2008, 02:44 PM Re: Turning off border makes text disappear??
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I thought I'd follow up to my previous post by posting an attachment of a page that I am working on today. It happens that this page is mostly just a navigation structure at this moment, and may be a good study for you. Although not exactly like the menu you are describing, the basic principal that you require is included here. I have tested this menu in Firefox, IE7, and IE6.
Attached Files
File Type: zip Spasmodic Dysphonia.zip (75.9 KB, 0 views)
__________________
Join me on
Please login or register to view this content. Registration is FREE

Last edited by wayfarer07; 04-19-2008 at 02:47 PM..
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 04-19-2008, 04:33 PM Re: Turning off border makes text disappear??
pealo86's Avatar
Super Spam Talker

Posts: 850
Name: Matt Pealing
Location: England, north west
Trades: 0
Thanks, but Ive just realised it fixes if I remove 'float:left' from #nav! Which is wierd, Ive always thought you needed that in there with a horizontal list??
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE
pealo86 is offline
Reply With Quote
View Public Profile Visit pealo86's homepage!
 
Old 04-20-2008, 11:53 AM Re: Turning off border makes text disappear??
LadynRed's Avatar
Defies a Status

Posts: 10,016
Location: Tennessee
Trades: 0
What you're running into is IE's stupid hasLayout nonsense. IE7 still uses it, so you're still going to run into this type of problem.

You might want to read this:
http://www.satzansatz.de/cssd/onhavinglayout.html
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Turning off border makes text disappear??
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28488 seconds with 13 queries