[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

CSS browser problem

Posted on 2004-10-26
8
Medium Priority
?
219 Views
Last Modified: 2012-05-05
Opera is rendering my page incorrectly - http://physicaljerks.co.uk/test/crew.php

The links are meant to sit side by side using the following code:

Style:

div.navbar {float: left;}
span.link {float: left;}

Html:

<div class="navbar">
<span class="link"><img ...></span>
<span class="link"><img ...></span>
<span class="link"><img ...></span>
<span class="link"><img ...></span>
<span class="link"><img ...></span>
</div>

This works fine in IE, Mozilla, Firefox, Netscape...but in Opera it stacks them up on top of each other and you cannot click on any of the links.

Correct render Screenshot in IE: http://www.keirmoffatt.com/ie.jpg
Incorrect render Screenshot in Opera: http://www.keirmoffatt.com/opera.jpg

Could anyone advise?

Keir
0
Comment
Question by:ikeir
  • 4
  • 4
8 Comments
 
LVL 10

Expert Comment

by:dij8
ID: 12410558
If you are just lining the links up one next to the other, why do you need the float left on the link spans?  Because they are inline elements they will do that automatically anyway.
0
 

Author Comment

by:ikeir
ID: 12410640
With float:left; removed, there is still no difference in Opera.
0
 
LVL 10

Expert Comment

by:dij8
ID: 12410676
Do you have any other CSS in your link class?

It may also be that you are naming the class link this is a reserved word in styles.  Trying using a different name.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 

Author Comment

by:ikeir
ID: 12410721
Ah ha, changed the classname to 'linky' and already looking better in Opera:
http://physicaljerks.co.uk/test/crew.php

But the final link does not fit on the end, and so leaps down to the next line. I thought this would be a padding/margin problem but after setting all to zero, still no luck. Any more ideas?
0
 
LVL 10

Accepted Solution

by:
dij8 earned 500 total points
ID: 12410807
Try losing the line breaks in your code.
<div class="navbar"><span class="link"><img ...></span><span class="link"><img ...></span><span class="link"><img ...></span><span class="link"><img ...></span><span class="link"><img ...></span></div>
0
 

Author Comment

by:ikeir
ID: 12410912
Thank you, that has fixed the problem...but I think that's utterly stupid - now to administrate the page I have to look at one huge line of code instead of well-layed out nested code - why is Opera doing this? Thank you for helping me fix it, but I am aggrevated by the solution I have had to use.
0
 
LVL 10

Expert Comment

by:dij8
ID: 12411015
The reason for it is because the line break in your code is considered a space of text.  If you look closely you will see a gap between each image when you do it the previous way.

I agree it is painful.  One would hope a line break could be considered no spacing as long as there isn't a space in the actual text itself but sadly this is not the case.  I thought the white-space setting in styles might help but looking at http://www.blooberry.com/indexdot/css/properties/text/whitespace.htm seems to suggest it wouldn't, you will still get that one space.
0
 

Author Comment

by:ikeir
ID: 12411039
Thanks again very much for your help.

Keir
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It's sometimes a bit tricky to use date functions in Oracle BPEL. I'll explain quickly how you can add N days to the current date. In a BPEL process this can be useful, and you can adapt it to fit your needs. First of all, let's see how to add 1 …
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

611 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question