Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wrapping text issue

Status
Not open for further replies.

jwhite68

IS-IT--Management
Jun 14, 2007
77
BG
I have the following line of code which displays a drop down box, and a text string to the right of it:

Code:
		document.getElementById('formdiv2').innerHTML='<select name="code" id="code" style="width:270px"><?=$codes?></select> (DD/MM/YYYY)';

The problem is, in Firefox it displays the (DD/MM/YYYY) underneath the drop down box - but in IE it correctly displays the (DD/MM/YYYY) to the right of it. Is there a better way to ensure that its on the same line?

I thought <span> would do it, but it didnt make any differece.
 
By default, they would appear side-by-side. I imagine the container you're putting them in is not wide enough... but we can't tell this from what you've posted.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
If thats the case though, why is it working fine in IE?
 
Different browsers apply different default paddings and margins so that may be why but, as Dan said, with the information we have all we can do is guess.


____________________________________________________________
Mark,
[URL unfurl="true"]http://aspnetlibrary.com[/url]

Need help finding an answer? Try the Search Facility or read FAQ222-2244.
 
If thats the case though, why is it working fine in IE?

I don't know, because you're still not giving much away. Perhaps the hint in my previous post was too subtle for you, so I'll be bit more direct.

Please can you show us the markup and CSS for the elements surrounding the select element, including that for the element with an ID of 'formdiv2'.

Dan

Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
I was able to get the desired result by just reducing the width in the code I published above - ie stting to:

Code:
width:265px

Its now displaying well in both IE and Firefox.

I appreciate that I havent provided code sections required - I will improve on my postings in the future. Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top