Reply
How to give fixed length of DIV in Firefox.
Old 07-02-2009, 06:58 AM How to give fixed length of DIV in Firefox.
Experienced Talker

Posts: 48
Name: Qasim Ali
Trades: 0
Hi, Guys!

I want to adjust a fixed width of a <DIV> in CSS. So when I give width:800px; in Internet Explore then it works and when I write same code in Firefox, it does not work and not adjust a fixed width.

You can see the code eaxmple here:

CSS Code
#body{
width:800px;
}

HTML code
<div id="body"></div>

So 800 px width automatically fix in IE but not in FF, So how can I fix a width of DIV in Firefox?

Regards,

Qasim Ali.
http://qaswallpapers.sitesled.com
Qasim Ali is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 07-03-2009, 11:57 AM Re: How to give fixed length of DIV in Firefox.
LadynRed's Avatar
Super Moderator

Posts: 8,821
Location: Tennessee
Trades: 0
Quote:
So 800 px width automatically fix in IE but not in FF, So how can I fix a width of DIV in Firefox?
What VERSION of IE are you using ? If it's less than 8, then IE does things incorrectly and will allow a div to stretch beyond any fixed width you give it. Firefox will give you 800px no matter what. So, Firefox is doing it right, IE is doing it wrong.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 12:32 PM Re: How to give fixed length of DIV in Firefox.
Experienced Talker

Posts: 48
Name: Qasim Ali
Trades: 0
Hi, LadynRed!

I am using IE 7.0. So What do you think that my (this) code would not work at IE 8.0. too? So at last please tell me its solution and DIV should work at FF and all other browsers as well.

Best Regards,

Qasim Ali
Qasim Ali is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 01:18 PM Re: How to give fixed length of DIV in Firefox.
LadynRed's Avatar
Super Moderator

Posts: 8,821
Location: Tennessee
Trades: 0
IE8 will operate more like Firefox as it has now become more standard-compliant than previous versions. I'm not sure if IE7 had the 'expanding box' problem or not, I'd have to go look that up.

If you set a height or width in Firefox, it WILL obey that dimension and will not 'stretch', which is what it is supposed to do. I don't really understand what it is you're actually trying to do. If you WANT it to stretch, but set a minimum width or height, then use min-height, or min-width - just be aware that older versions of IE do not support those properties.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 03:26 PM Re: How to give fixed length of DIV in Firefox.
Experienced Talker

Posts: 48
Name: Qasim Ali
Trades: 0
Hi, LadynRed!

Actually I want that <div> length should be fixed as I want 800 px. I don't want to stretch <DIV>. But in IE 7, my (upper given) coding works but not in Firefox.

In simple words, I want a <DIV> column should be a fixed length and width. So how can I do it in all Browsers? For Example we set a tables' Length and Width as we want as our requirement. So I want to do same process using <DIV>. So I think you will have understand my problem. I want, you to do change in upper given code so that it works same in all browsers.

Qasim Ali.
__________________
Hollywood Wallpapers

Last edited by Qasim Ali; 07-04-2009 at 03:30 PM..
Qasim Ali is offline
Reply With Quote
View Public Profile
 
Old 07-04-2009, 06:38 PM Re: How to give fixed length of DIV in Firefox.
LadynRed's Avatar
Super Moderator

Posts: 8,821
Location: Tennessee
Trades: 0
Quote:
I want that <div> length should be fixed as I want 800 px. I don't want to stretch <DIV>
Then all you do is set the HEIGHT of the div to 800px. Firefox will NOT stretch it, but IE WILL.

Lets see your code.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!
"Using or working with IE is like having to wear a 1970's polyester suit with pantyhose and a girdle, to work everyday"
Carolina Corvette Club
LadynRed is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to give fixed length of DIV in Firefox.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.12710 seconds with 13 queries