473,387 Members | 1,678 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

IE span not same width as Firefox

Hi!

I have a problem with IE not using all space for span. Firefox uses as much space as possible, which is exactly what I wanted, but IE breaks at hyphens and word breaks at what looks like random positions.

The span is in a div. The span has a class="link_description" and the div has an id="d_links".

.link_description {
font-family: verdana, sans-serif;
font-size: 8pt;
color: #cc6600;
clear: both;
float: left;
margin-bottom: 20px;
}

#d_links {
width: 400px;
height: 400px;
margin-top: 45px;
margin-left: 225px;
position: absolute;
}

You can view an example at http://laeder.se/beta . The site is in swedish though and the tab in question is "länkar" which meens links. If you click on "rollspel" or "musik" and so on you will get links on the right side. I fetch those from an xml file so it's hard to see the generated html from the xslt file.

I know that a width: 100% would fix it, but that feels like a hack.

Thanks in advance!
Dec 3 '06 #1
5 7310
AricC
1,892 Expert 1GB
Have you tried this CSS white-space: nowrap?
Dec 3 '06 #2
Yes I did, but that made the text not wrap at all. I want the text to wrap at the end of the div. With nowrap it will just pass the div and continue until the end of the line. This happend it both IE and Firefox.

I thougt the idea of a span, as I understood it, was to be the lenght of it's content unless it runs out of space. IE obviously has another idea and I don't know how it interprets the code.
Dec 3 '06 #3
Oh well, I ended up using white-space: nowrap for the link_text and link_url and width: 100% for link_description. Now it finally looks the same in both browsers, but being a programmer I'm really frustraded to having to make a work-around for something that I really don't understand.

Is IE broken? Is Firefox broken? Or are they just not agreeing on how to interpret the span-tag?

Anyway, thanks for the input!
Dec 3 '06 #4
drhowarddrfine
7,435 Expert 4TB
IE6 and IE7 are old, buggy and non-standard browsers; the worst on the planet. Firefox and others are more up to date with web standards. So you must make your initial code tests in Firefox or Opera, then adjust IEs quirks and bugs. You don't make the modern browsers look like IE but try and make IE work like modern browsers.

Hm. She doesn't look Swedish.
Dec 3 '06 #5
I use Ultraedit for development and Firefox to view the result. Most things looks and work ok in IE, but sometimes I encounter differences that I have to work around. And I suspected that it was IE that was broken.

And you're absolutely right. She's not swedish. She's thai.
Dec 3 '06 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: hsomob1999 | last post by:
so i have a <ul> and I allow the user to append items to it. The problem is that on mozilla the <span class="line"> which is just a line to divide the sections gets overlaped and doesnt move down...
2
by: ricky | last post by:
Hello, If anyone could help me with this I would highly appreciate it. I've tried everything and nothing works. What I am trying to do is so damn basic and it's just frustrating that it seems...
2
by: James Black | last post by:
I am dynamically generating a table in IE to display some information. I will probably change it to divs later, but I just want to get it working properly first. In my div I have the following...
5
by: David Housman | last post by:
Hello, I'm trying to implement a navigation bar with a ul in css. The code is a template, but i'm customizing. I can handle just text in each block, but i want the first block to have an image...
6
by: lilOlMe | last post by:
Hi there! I'm having a problem with a <span> element's width. I have a span element within a div block: <div class="picker"> <span id="ctl00_cph_mainContent_TPKR_Tues_LBL_TitleForPicker"...
5
by: Summercool | last post by:
wow... i didn't know that, for <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http:// www.w3.org/TR/html4/loose.dtd"> <span style="width: 100px; background:...
3
by: Steve | last post by:
Hi; I'm working on a demo of using a timer on a web site that is made visible by making a div visible. My "PopIn Box" div is empty on the page. Before making it visible I used javascript to...
5
by: Brent | last post by:
Take this small HTML fragment: span.theClass{float:left;width:100px;cursor:pointer;cursor:hand;} ------------------------ <div> <span id="1" class="theClass">&nbsp;<span> <span id="2"...
6
by: liketofindoutwhy | last post by:
There is a link that encloses a span (or a div), but the link won't work in IE 7 (clicking on video image works, but not on the play button), while it works well in Firefox 2 and 3, and Safari 3....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.