CSS problem with block-width

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

CSS problem with block-width

Post 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
SideshowBob
Forum Members
Forum Members
Posts: 80
Joined: Thu Sep 13, 2007 10:50 am

Re: CSS problem with block-width

Post 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
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

Re: CSS problem with block-width

Post by musicscore »

I never understood this but YES YES, this is the solution.
Using 'stirct mode' [font=Verdana] [/font] solved my problem.  ;D ;D ;D

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
musicscore
Power Poster
Power Poster
Posts: 496
Joined: Wed Jan 25, 2006 11:53 am

Re: CSS problem with block-width (Please Help)

Post 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
SideshowBob
Forum Members
Forum Members
Posts: 80
Joined: Thu Sep 13, 2007 10:50 am

Re: CSS problem with block-width

Post 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
Post Reply

Return to “Layout and Design (CSS & HTML)”