/    Sign up×
Community /Pin to ProfileBookmark

Random text appearing in IE6

Hi,

I have a form that has select boxes and corresponding labels.

e.g.

[code]
<div id=”rfq_form”>
<label for=”ddlExistingFleet”>Existing Vehicles:</Label>
<select name=”ddExistingFleet” ID=”ddlExistingFleet”>
<option VALUE=”10″>1-10 Vehicles</option>
<option VALUE=”20″>11-20 Vehicles</option>
<option VALUE=”30″>21-30 Vehicles</option>
</select>
</div>
[/code]

and the css to style them:

[code]

#rfq_form label{
width: 175px;
}

#rfq_form select{
float: left;
margin-left: 25px;
width: 175px;
}
[/code]

Nothing too exciting and nothing difficult… and it looks fine in all browsers… except IE6. Grrrrrr. Basically what happens is that a copy of part of the label appears below the label and select box. I’ve included a screen shot to explain better than I can.

I’ve checked the source code and its not in there and its only IE6 that appears to be doing this. Does anyone know how to fix this?

Thanks

[/code]

[upl-file uuid=5633c5d6-8bd6-462b-b8e9-c4214c505c88 size=43kB]ie6_bug.jpg[/upl-file]

to post a comment
CSS

14 Comments(s)

Copy linkTweet thisAlerts:
@scouseauthorJul 21.2009 — Hmmm, I've just found this site explaining something similar:

http://www.positioniseverything.net/explorer/dup-characters.html

but I don't have any comments in that particular bit of code!!
Copy linkTweet thisAlerts:
@6StringGeekJul 21.2009 — http://www.positioniseverything.net/explorer/dup-characters.html

That's funny...you just beat me. Try removing your comments one at a time. With IE you never know why it's puking.
Copy linkTweet thisAlerts:
@pawan143_5Jul 21.2009 — Try to put float:left in #rfq_form label like this......

#rfq_form label{

width: 175px;

float:left;

}
Copy linkTweet thisAlerts:
@Andyram2kJul 21.2009 — Hi,

Try adding a margin-right of -3px on the element and that should correct the issue. I've come across this quite a few times in IE6 testing, and this should hopefully work for you too.

Hope this helps.
Copy linkTweet thisAlerts:
@scouseauthorJul 22.2009 — Thanks for all your replies guys.

6StringGeek, I did try the suggestions on the site, but when I investigated the source code I found that I actually didn't have any comments anywhere in my code... so it wasn't that bug! ?

pawan143_5, I tried that, but it didn't seem to have any effect.

Andyram2k, at first I tried your solution and it didn't seem to work. But then I put margin-right in the <select> element instead of the <label> element and that fixed it! YAY! ?

Thanks for everyone's help. The sooner IE6 is abolished the better for us all! ha!
Copy linkTweet thisAlerts:
@Andyram2kJul 22.2009 — Cool ? I do quite a bit of testing for IE6 so i come up against these issues quite a lot. I completely agree that IE6 should be burned to the ground, but until then we have to make sure our sites work well in all browsers ?
Copy linkTweet thisAlerts:
@scouseauthorJul 22.2009 — Yea, I do quite a lot of browser testing as well and normally have a separate IE6.css, which usually makes things a bit easier when trying to get my sites to look good on all browsers.

I just hadn't come across the "magic appearing text" bug yet! Well at least I know how to fix it from now on! ?

It's interesting (annoying) that I sometimes have to use separate style sheets for IE6 and IE7, whereas I can get pretty much the rest of the browsers looking spot on using the SAME style sheet!! Hmmm, what's that say about IE!! haha
Copy linkTweet thisAlerts:
@Andyram2kJul 22.2009 — It is possible to have all styles in one single stylesheet and accommodate for all browsers, i do it for my day job. You just have to do a bit of research into what you need something to do and find the best styling method for it ?
Copy linkTweet thisAlerts:
@scouseauthorJul 23.2009 — Yea, I know. But unfortunately in my job I have a boss who wants a million things doing and he wants them done yesterday. ? So its usually easier for me to separate the style sheets depending on browser. I usually have a master css style sheet that covers everything and then an IE6 an/or IE7 style sheet that have certain rules that overrule the same rules in the main.css.

However, when I've been learning I have read quite a lot of articles saying that separating styles sheets in this way is a good thing? Instead of using hacks etc. But are you saying that you can have everything in the same style sheet, for all browsers, without hacks and it looking the same across all browsers? I would be interested in reading about that as it would make maintaining the site MUCH easier if there was only one file I had to worry about! ?
Copy linkTweet thisAlerts:
@Andyram2kJul 23.2009 — Yes, you can get things into one stylesheet, but i would stick to the multiple stylesheets option, as it will be easier to maintain by yourself, and also if others need to edit in future ? This will avoid a potential headache moment for your Boss if you go to Hawaii for 2 weeks ?
Copy linkTweet thisAlerts:
@scouseauthorJul 23.2009 — Haha fair enough!

oh and feel free if you want to ring my boss and suggest I have 2 weeks in Hawaii! ?
Copy linkTweet thisAlerts:
@mk31762Jul 24.2009 — I can't believe it. I'm reading a forum thread that directly relates to a problem I am having and there's has been activity in it in the last 24 hours.

Sadly, the fix described didn;t work for me. I have no comments and I tried applying the negative right margin to a couple of different adjacent elements, but nothing so far has fixed the problem.

Any other ideas? I am open to suggestions.
Copy linkTweet thisAlerts:
@mk31762Jul 24.2009 — Nevermind. I had to add the -3px margin to the containing div tag in my case, not the select.
Copy linkTweet thisAlerts:
@Andyram2kJul 24.2009 — Yeah, it's usually on the div. Glad this has been of help ?
×

Success!

Help @scouse spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...