[SOLVED] My nav images

This is a discussion on "[SOLVED] My nav images" within the Web Page Design section. This forum, and the thread "[SOLVED] My nav images are both part of the Design Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1  
Old Dec 23rd, 2007, 15:27
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
[SOLVED] My nav images

My web server is down for some reason or another, luckily I have more than one.

http://adrianrodriguez.frihost.net/index.htm

When you go there on Firefox, the navigation is there, but it doesn't show on Internet explorer. How can I fix that?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Dec 23rd, 2007, 15:48
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

there is no width and height setting on your nav images.

you have width and height settings like this width: 52; try width: 52px;

use px on all your width and height settings.

hope this helps.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Dec 23rd, 2007, 16:27
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

That didn't work for me...should I set the width and height of the div?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Dec 23rd, 2007, 16:31
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

I looked at your CSS. You didn't set correct widths and heights at all! You're still missing "px" for every one!
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)

Last edited by Stuart; Dec 23rd, 2007 at 16:34.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Dec 23rd, 2007, 16:38
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

O sorry, I tried it on my computer before I uploaded it. It didn't work on my computer, so I didn't think it would work on the internet.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Dec 23rd, 2007, 16:46
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

have you tried it online. the px missing off your width and height settings is stopping your css from validating.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Dec 23rd, 2007, 16:50
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

Yes I just put it online. And yes it is validated. I still get the problem though.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Dec 23rd, 2007, 17:30
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,324
Blog Entries: 2
Thanks: 9
Thanked 48 Times in 45 Posts
Re: My nav images

Your last anchor closing tag is incomplete. You need to fix that.

Then to fix your IE problem you need some text within the anchor. For example
Code: Select all
<li id="nav2"><a href=" ">text here</a></li>
Then add this declaration in your CSS to hide the text:
Code: Select all
#nav a {
text-indent: -5000px;
}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Dec 23rd, 2007, 17:36
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

That causes a problem in firefox now and still doesnt work on ie
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Dec 23rd, 2007, 17:40
Aso's Avatar
Aso Aso is offline
Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,324
Blog Entries: 2
Thanks: 9
Thanked 48 Times in 45 Posts
Re: My nav images

You need
Code: Select all
#nav a {
display: block;
}
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Dec 23rd, 2007, 21:21
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

Now it makes them line up on top of each other, and not in a line.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Dec 23rd, 2007, 21:53
Reputable Member
Join Date: Jun 2007
Location: uk
Posts: 459
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

give this a go.

HTML: Select all
#nav li { 
display : inline;
} 
#nav { 
float : right;
margin-right : 40px;


} 
#nav1 a { 
background-image:url(images/nav1.gif);

    width:51px;
    height:37px;
    float: left;
    
    text-align: center;
    display: block;            

} 
#nav1 a:hover { 
background : url(images/nav1-2.gif) no-repeat;
width : 51px;
height : 37px;
display:inline;
} 
#nav1 a:active { 
background-image: url(images/nav1-2.gif) no-repeat;
width : 51px;
height : 37px;
display:inline;
} 
#nav2 a { 
background : url(images/nav2.gif) no-repeat;
width : 52px;
height : 37px;
float: left;
display: block;
} 
#nav2 a:hover { 
background : url(images/nav2-2.gif) no-repeat;
width : 52px;
height : 37px;
display:inline;
} 
#nav3 a { 
background : url(images/nav3.gif) no-repeat;
width : 72px;
height : 37px;
float: left;
display: block;} 


#nav3 a:hover { 
background : url(images/nav3-2.gif) no-repeat;
width : 72px;
height : 37px;
display:inline;
} 
#nav4 a { 
background : url(images/nav4.gif) no-repeat;
padding : 17px 45px 0 10px;
width : 68px;
height : 37px;
float: left;
display: block;} 


#nav4 a:hover { 
background : url(images/nav4-2.gif) no-repeat;
width : 68px;
height : 37px;
display:inline;
} 
I'm sure there are some short cuts you could take but this should work for now.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #13  
Old Dec 24th, 2007, 01:39
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

Now it's really messed up....what could it be?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #14  
Old Dec 24th, 2007, 02:04
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

OK. I fixed your code and tested it. It should work now.

Entire CSS:
Code: Select all
body 
{
    background-color: #303B4A; 
    margin: 0px; 
    padding: 0px; 
    text-align: center; 
    color: #303B4A;
 }
 
    /*LAYOUT STYLES*/
 
#container 
{
    background-image: url(http://adrianrodriguez.frihost.net/images/bg.gif); 
    background-repeat: repeat-y; 
    width: 840px; 
    height: 1000px;
    text-align: center; 
    margin: 0px auto 0px auto;
 }
 
#head 
{
    text-align: center;
}

    /*HEADER*/

#head img 
{
    margin-top: 10px; 
    border: 0;
 }
 
    /*NAVIGATION*/
 
#nav li { 
display : inline;
} 
#nav { 
float : right;
}
#nav ul li a {
padding : 17px 20px 0 10px;
}
#nav ul li a span {
display:none;
}
#nav1 a 
{
    background:url(http://adrianrodriguez.frihost.net/images/nav1.gif) no-repeat;
    width:51px;
    height:37px;
    float: left;
    text-align: center;
    display: block;
} 
#nav1 a:hover { 
background : url(http://adrianrodriguez.frihost.net/images/nav1-2.gif) no-repeat;
width : 51px;
height : 37px;
display:inline;
} 
#nav1 a:active { 
background-image: url(http://adrianrodriguez.frihost.net/images/nav1-2.gif) no-repeat;
width : 51px;
height : 37px;
display:inline;
} 
#nav2 a { 
background : url(http://adrianrodriguez.frihost.net/images/nav2.gif) no-repeat;
width : 52px;
height : 37px;
float: left;
display: block;
} 
#nav2 a:hover { 
background : url(http://adrianrodriguez.frihost.net/images/nav2-2.gif) no-repeat;
width : 52px;
height : 37px;
display:inline;
} 
#nav3 a { 
background : url(http://adrianrodriguez.frihost.net/images/nav3.gif) no-repeat;
width : 72px;
height : 37px;
float: left;
display: block;} 


#nav3 a:hover { 
background : url(http://adrianrodriguez.frihost.net/images/nav3-2.gif) no-repeat;
width : 72px;
height : 37px;
display:inline;
} 
#nav4 a { 
background : url(http://adrianrodriguez.frihost.net/images/nav4.gif) no-repeat;
width : 68px;
height : 37px;
float: left;
display: block;} 


#nav4 a:hover { 
background : url(http://adrianrodriguez.frihost.net/images/nav4-2.gif) no-repeat;
width : 68px;
height : 37px;
display:inline;
}
Entire HTML:
HTML: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Adrian Rodriguez | Web and Graphic Designer</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div id="container">
    <div id="head">
    <a href="adrian-rodriguez.net"><img src="images/header.gif" alt="Adrian Rodriguez | Web and Graphic Designer" /></a>
    </div>

    <div id="nav">
    <ul>
    <li id="nav1"><a href="index.htm"><span>Home</span></a></li>
    <li id="nav2"><a href=" "><span>About</span></a></li>
    <li id="nav3"><a href=" "><span>Portfolio</span></a></li>
    <li id="nav4"><a href=" "><span>Contact</span></a></li>
    </ul>

    </div>
</div>

</body>
</html>
The above code, css and html, is all you need!

Hope that helps!
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #15  
Old Dec 24th, 2007, 02:31
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

It worked great. Finally! Thank for all your help guys. There is a bit of a gap between the nav in firefox, but that's ok....I do want to fix that though...it will probably affect ie as well.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #16  
Old Dec 24th, 2007, 02:33
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

Which gap do you mean? The one between the links? That's easy to do:
Code: Select all
#nav ul li a {
padding : 17px 20px 0 10px;
Reduce those two numbers a bit, and that should do it.

Cheers
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #17  
Old Dec 24th, 2007, 02:36
Reputable Member
Join Date: Oct 2007
Location: At my house
Age: 22
Posts: 193
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

Sorry I meant the gap between the header and the nav...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #18  
Old Dec 24th, 2007, 02:39
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: My nav images

That, also, is quite easy. Add this:
Code: Select all
#nav { 
float : right;
margin-top:-10px;
}
And that, again, should do it!
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #19  
Old Dec 24th, 2007, 03:09