homepage Welcome to WebmasterWorld Guest from 54.235.227.60
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Browsers / Firefox Browser Usage and Support
Forum Library, Charter, Moderators: incrediBILL

Firefox Browser Usage and Support Forum

    
Div tag and long URL - Firefox does not keep fixed width
simple question, really
aleksl




msg:3617713
 12:29 am on Apr 3, 2008 (gmt 0)

I've got a real simple question on div tags. I have a div that is fixed width, and it has a bunch of text posted in it by users (say, like a blog). If user posts a long URL, I will get different behavior in Firefox and IE - in IE a div with fixed width will stay the same (text will wrap), however in Firefox it expands to as long as a URL is, messing up other design.

Correction, there's a div, then table inside with 2 columns, top one has a "header" - different color, etc., bottom row is text.

Question of the day - how do I fix it? I like how IE behaves in this case - width stays the same and doesn't expand. Can this be fixed for Firefox?

 

penders




msg:3626391
 1:15 pm on Apr 14, 2008 (gmt 0)

...in IE a div with fixed width will stay the same (text will wrap), however in Firefox it expands to as long as a URL is, messing up other design.

Are you sure the DIV is expanding, or may be the contents is spilling out of the container? In my experience IE will tend to stretch the DIV container to make its contents fit - certainly if the contents is a table that refuses to wrap?

If you want to fix the width of your DIV container, you might need to add overflow:hidden to your DIV. However, any content that spills out of your DIV will not be visible.

aleksl




msg:3627147
 7:49 am on Apr 15, 2008 (gmt 0)

yes, you are correct,content is actually silling over DIV. Any idea on how to prevent that?

penders




msg:3627215
 10:19 am on Apr 15, 2008 (gmt 0)

To prevent the content spilling out of the DIV, ie. to fix the width of the DIV and not let it expand, you need to set
overflow:hidden on the DIV. However, the content is still unlikely to fit, you just won't see anything that is outside the bounds of your DIV container.
Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Browsers / Firefox Browser Usage and Support
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved