Page 1 of 1
CSS problem with block-width
Posted: Fri Sep 28, 2007 3:55 pm
by musicscore
I use this CSS code :
display: block;
width: 250px;
border: 2px solid #feecde;
border-top: 27px solid #feecde;
margin: 10px 0px 0px 0px;
padding: 10px;
font-size: 12px;
line-height: 15px;
With IE6 the width of the block is 250 pixels but with firefox the width is 250 + 10 (padding) + 4 (border).
How can I set the width of this block 250 in IE6 and in Firefox.
Please help !!!!!
Musicscore
Re: CSS problem with block-width
Posted: Fri Sep 28, 2007 4:58 pm
by SideshowBob
Hi There,
Check that you are not using "quirks" mode, this causes IE to use the wrong box model.
Basically check your doctype, it should look something like the below:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Potentially this is quite a deep subject but a sound understanding of the box model is very useful. You can read more here
http://www.quirksmode.org/css/quirksmode.html
Post a link if you are still stuck.
Bob
Re: CSS problem with block-width
Posted: Mon Oct 08, 2007 1:29 pm
by musicscore
I never understood this but YES YES, this is the solution.
Using 'stirct mode' [
font=Verdana] [/font] solved my problem.
On the otherhand, got a new problem.
I always used a table with a height of 100%. This gave me a table with filled the who screen.
In strict mode this doesn't seems to work.
Is there a solution for this problem ??
Thanx again.
Musicscore
Re: CSS problem with block-width (Please Help)
Posted: Wed Oct 10, 2007 8:53 am
by musicscore
Can someone help me with the described problem.
In strict mode I cann't get the height of my table (screen) 100% of the screen with IE6.
Please help
Musicscore
Re: CSS problem with block-width
Posted: Wed Oct 10, 2007 10:15 am
by SideshowBob
Hi Musicscore,
Strict mode makes life very difficult, I would recommend transitional mode (as in my previous post) unless you have a very good reason for strict. View the source of some of your favourites websites and the chances are they are using transitional.
I don't use table but I think the below css will help. Make sure your table id=main
Code: Select all
html, body, table#main {height: 100%}
Bob