Web Design Forum: browser behaviour - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

browser behaviour firefox

#1 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 08:33 AM

hi

i would like to display a picture and once clicked i would like it to open in a new window. This works fine for IE, however firefox seems to jiggle the code around. i say this as when i look at it with firebug it moves the target="" to before my href="". il show the sample code below:

<li>
<a href="http://www.sforsugar.com" target="_blank">
<img src="images/sforsugarthumb.jpg" alt="SforSugar.com" />
</a>


firefox displays as:

<a target="_blank" href="http://www.sforsugar.com"><img alt="SforSugar.com" src="images/sforsugarthumb.jpg"></a>


is this a known behavioural difference for firefox and would i have to enter another line of code specifically for firefox, or am i doing it incorrectly and cannot see it?

many thanks

dave

This post has been edited by Renaissance-Design: 08 February 2012 - 01:15 PM
Reason for edit: Please use the code button or tags to format your code.

0

#2 User is online   MikeChipshop 

  • Small but imperfectly formed
  • Group: Moderators
  • Posts: 7,047
  • Joined: 19-April 10
  • Reputation: 503
  • Gender:Male
  • Location:Scotland

Posted 08 February 2012 - 08:47 AM

Not seen this myself but it really shouldn't make any difference to the actual page.
0

#3 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,938
  • Joined: 14-February 08
  • Reputation: 183
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 08 February 2012 - 08:59 AM

I think you'll find this is firebug's work, not firefox. If you view source in firefox you should find it's exactly as written in your html file. I've noticed firebug occasionally re-orders elements. It's just firebug trying to be helpful, and it definitely makes no difference to the way your page works.
0

#4 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 09:10 AM

ok thanks. il look into it more why firefox wont accept it then
0

#5 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,938
  • Joined: 14-February 08
  • Reputation: 183
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 08 February 2012 - 09:21 AM

Can you explain your problem in more detail? What do you mean firefox won't accept it?
0

#6 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 09:25 AM

ie works properly. when u hover over the image you can click and the link will open in the new window as planned.

in firefox when i hover over the image nothing happens.
0

#7 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,938
  • Joined: 14-February 08
  • Reputation: 183
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 08 February 2012 - 09:30 AM

Can you post a link to your page, or the whole html document? Sounds like you may have an unclosed tag or something. Running your page through the W3C validator would show this up.
0

#8 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 09:39 AM

yeah sure. ive had a look in notepad++ and maybe ive been looking too long cos i cant see it.

page is: http://www.swaleitse...o.uk/index.html
thanks
0

#9 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,938
  • Joined: 14-February 08
  • Reputation: 183
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 08 February 2012 - 10:07 AM

The reason it's not working is because the <img> is floated inside the <a> causing it to collapse. Just add overflow:auto to the <a> in your stylesheet and it should fix this.
0

#10 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 11:12 AM

ok ive added this to my style sheet as you advised:

a { color:#cc7108; outline:none; overflow:auto;}
a:hover{text-decoration:none; }



still no luck.... :(

This post has been edited by Renaissance-Design: 08 February 2012 - 01:15 PM
Reason for edit: Please use the code button or tags to format your code.

0

#11 User is online   notbanksy 

  • Refreshingly Belligerent Marxist
  • PipPipPipPipPip
  • View gallery
  • Group: Members
  • Posts: 3,938
  • Joined: 14-February 08
  • Reputation: 183
  • Gender:Male
  • Location:Darkest rural Somersetshire
  • Experience:Advanced
  • Area of Expertise:Copywriter

Posted 08 February 2012 - 12:14 PM

Ahhh, you're right. Wasn't expecting that, but having looked more closely I now see what's the problem (even if I can't figure out how it occurred. Here's how to fix it: float the <h4> and <p> in your <li> like so

.list1 li p, .list1 li h4 {
float:left;
width:165px;
}


Without being floated, they're sitting in front of the <a> tag. I suppose you might be able to fix this using zindex, but to my mind, this way is better.
0

#12 User is offline   daver 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 20
  • Joined: 13-February 08
  • Reputation: 0
  • Experience:Nothing
  • Area of Expertise:Designer

Posted 08 February 2012 - 12:28 PM

fantastic thanks alot.

so it was the relative positioning that was throwing everything out ?

its strange that it would do that for one browser and not another though isnt it ?

thanks again

dave
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users