School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,574 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 2,194 people online right now. Registration is fast and FREE... Join Now!




Navigation links in Firefox

 

Navigation links in Firefox, Navigation links not working/paritally working in Firefox

laughinannie

4 Jun, 2009 - 04:28 PM
Post #1

New D.I.C Head
*

Joined: 4 Jun, 2009
Posts: 3


My Contributions
I'm working with CSS and PHP. My navigation consists of transparent PNGs (and I've tried other formats as a test). The links work in IE, but not in Firefox (or sometimes only a small part of the image is clickable). I've never come across this before - anyone else had similar issues or ideas for a solution?

CODE


CSS:

#nav {
    float: left;
    position: relative;
    width: 250px;
    text-align: left;
    margin-left: 25px;
    padding-right: 25px;
    margin-top: 20px;
            }
        
img.navtext {
    border-width: 0;
    padding-bottom: -3em;
    }
    
img.nav2 {
        padding-bottom: -3em;
        text-indent: 15px;
    }
        
/* Hack for IE5* which misinterprets the width */
* #nav {
    width: 100%;
    w\idth: auto;
    
    }
/* end hack */

PHP:

<div id="nav">
  <p><a href="http://www.gotchacoveredlinens.ca/index.php"><img src="images/home.png" border="0" class="navtext"></a></p>
  <p><a href="http://www.gotchacoveredlinens.ca/about.php" ><img src="images/about.png" alt="about" border="0" class="navtext"></a></p>
  <p><a href="http://www.gotchacoveredlinens.ca/products.php"><img src="images/products.png" alt="products" border="0" class="navtext"></a> </p>
  <p><a href="http://www.gotchacoveredlinens.ca/sashes.php"><img src="images/sashes.png" alt="sashes" border="0" class="nav2"></a></p>
  <p><a href="chaircovers.php"><img src="images/chaircovers.png" alt="chair covers" border="0" class="nav2"></a></p>
  <p><a href="overlays.php"><img src="images/overlays.png" alt="overlays" border="0" class="nav2"></a></p>
  <p><a href="runners.php"><img src="images/runners.png" alt="runners" border="0" class="nav2"></a></p>
  <p><a href="order.php"><img src="images/order.png" alt="order" border="0" class="navtext"></a></p>
  <p><a href="gallery.php"><img src="images/gallery.png" alt="gallery" border="0" class="navtext"></a></p>
  
</div>



User is offlineProfile CardPM
+Quote Post


RudiVisser

RE: Navigation Links In Firefox

5 Jun, 2009 - 05:51 AM
Post #2

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,875



Thanked: 138 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
Have you tried properly closing the img tag? I assume you're trying to write XHTML (the code above isn't PHP it's (X)HTML) but what doctype are you using?

Firefox likes to do things it's own rubbish way anyway, but there shouldn't really be a problem with what you posted, although I don't understand your CSS, nor why you're using paragraph tags for a single link.

Have you tried just floating the images left so they line up next to each other?
User is offlineProfile CardPM
+Quote Post

Wimpy

RE: Navigation Links In Firefox

6 Jun, 2009 - 03:08 AM
Post #3

I feel happy... *singing*
Group Icon

Joined: 2 May, 2009
Posts: 955



Thanked: 130 times
Dream Kudos: 75
My Contributions
@MageUK: "Firefox likes to do things it's own rubbish way anyway"; What do you mean by saying that? If there's a browser doing things it's own rubbish way it's Internet Explorer... smile.gif

@laughinannie:
The problem you have might be the "padding-bottom: -3em", which shouldn't even be possible to do, but Firefox might interpret it anyway and remove 3em of the images area and therefore also make the links work in a weird way.

I'm also curious about the "Hack for IE5* which misinterprets the width"-thing, why even bother about IE5, people should at least be using IE6 nowadays if not even IE7? And also, I have never had any problems with IE5 and widths, what's up with that?! smile.gif
User is offlineProfile CardPM
+Quote Post

laughinannie

RE: Navigation Links In Firefox

9 Jun, 2009 - 08:55 PM
Post #4

New D.I.C Head
*

Joined: 4 Jun, 2009
Posts: 3


My Contributions
Thanks for the insights MageUK and Wimpy - I clearly have a lot to learn! I'll try both of your suggestions... and thanks for picking up on my little mistakes so I can clean it up! Much appreciated - will report back.
User is offlineProfile CardPM
+Quote Post

RudiVisser

RE: Navigation Links In Firefox

9 Jun, 2009 - 11:33 PM
Post #5

.. does not guess solutions
Group Icon

Joined: 5 Jun, 2009
Posts: 1,875



Thanked: 138 times
Dream Kudos: 125
Expert In: PHP, MySQL, HTML, CSS, C#

My Contributions
QUOTE(Wimpy @ 6 Jun, 2009 - 03:08 AM) *

@MageUK: "Firefox likes to do things it's own rubbish way anyway"; What do you mean by saying that? If there's a browser doing things it's own rubbish way it's Internet Explorer... smile.gif

Off-Topic but Firefox is more prone to doing things differently than everyone else from my experience. It couldn't even handle float:right correctly at one point.
User is offlineProfile CardPM
+Quote Post

laughinannie

RE: Navigation Links In Firefox

10 Jun, 2009 - 10:48 AM
Post #6

New D.I.C Head
*

Joined: 4 Jun, 2009
Posts: 3


My Contributions
Well, this is interesting - when I removed all the padding/margin information from the nav in the CSS file, the links started working. They look terrible and sit funny, but I'll try a few work-arounds.

The <p> tags around the links were to make the nav spread out a bit more (my friend who I'm doing this for - obviously just as a favor since I'm no pro! - wanted it to look that way), and to make it read vertically. I thought I should be able to do it by controlling the width and padding of the nav, but for some reason it didn't work. I know the <p> isn't ideal - it was a bit of a lame work-around.

You're right about IE5 - it's a throw-back from when I was first learning.

Thank you both so much for your insights. If anything else occurs to you, I'm always willing to learn! Hopefully I'll learn enough to return the favor for someone one day.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 08:11AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month