Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2006
    Posts
    82
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Text-indent and inline-block in IE 7

    Hi there,

    I've been fumbling around for about 3 hours trying to get this to work, but alas, I've failed!

    I have a horizontal nav with about 7 items in it - each one looks like this with it's own class:

    Code:
    <li class="about-nav><a href="/about">About</a></li>
    These elements are wrapped inside a <nav> element which sits inside a <header> element.

    Each nav element has a background image attached to it and I've set a text-indent of -9999px so that the text itself does not appear.

    Everything seems to work fine in IE8 (haven't tested higher yet), but in IE7 the nav items are all invisible. The nav itself is there and I have code in place to reecognise the HTML 5 elements, but it seems IE7 doesn't like text-indent or inline-block. I've discovered that much, but none of the attempts to rectify it have helped so far. Here is my cass:

    Code:
    nav {
    	width: 970px;
    	margin: 0 auto;
    	height: 37px;
    	border: 1px solid red;
    	padding-top: 10px;
    }
    
    nav ol li {
    	display: inline;
    }
    
    nav ol li.about-nav a {
      width: 95px; 
      height: 37px;
      background: url("../images/nav/about.png") no-repeat;
      text-indent: -9999px;
      display: inline-block;
    }
    Now I've tried this but it doesn't do anything:

    Code:
    nav ol li.about-nav a {
      width: 95px; 
      height: 37px;
      background: url("../images/nav/about.png") no-repeat;
      text-indent: -9999px;
      display: inline-block;
    *display:inline;
      text-transform: capitalize;
      zoom:1;
    }
    The only thing that does make it show is changing display: inline to display: block, but then my horizontal nav breaks onto new lines.

    Any help greatly appreciated!

  • #2
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Hello littlejones,
    Your markup is invalid - look at the missing quotation mark I've highlighted in red : <li class="about-nav"><a href="/about">About</a></li>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #3
    New Coder
    Join Date
    Oct 2006
    Posts
    82
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Sorry that's my mistake, it is valid but I cut and paste into here and removed the PHP before posting the thread and accidentally took that quote off. So that's not the problem.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    Quote Originally Posted by littlejones View Post
    Sorry that's my mistake, it is valid but I cut and paste into here and removed the PHP before posting the thread and accidentally took that quote off. So that's not the problem.
    Maybe it would help if you posted the actual markup then.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,673
    Thanks
    22
    Thanked 1,827 Times in 1,811 Posts
    It's your HTML5 elements, <header> and <nav> are not supported by those older browsers.

    See a demo I have on how to fix that here.
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •