Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE has different height/width for div than Firefox

I'm having trouble with div height and width in IE.

On my web page, http://www.ricominciodame.it/eventi.php, there are some divs with a blackboard style.
In Firefox, they all work fine, but in IE (both 7 and 8) the width is lower and the background is cut.

The following is my CSS:

div.evento {
    background : white url("images/sfondo_evento.png") top no-repeat;
    width : 260px;
    height : 207px;
    margin:5px;
    margin-left:0px;
    margin-bottom : 20px;
    padding-left : 20px;
    padding-right : 20px;
    padding-top : 20px;
    padding-bottom : 20px;
    color : white;
}

How can I fix this problem?

like image 289
pAkY88 Avatar asked Dec 10 '22 11:12

pAkY88


2 Answers

Your page is running in ie quirks mode caused by the DOCTYPE. You have to use any of these http://www.w3.org/QA/2002/04/valid-dtd-list.html

Also, it's good to validate always your web site, from w3 validator.

like image 103
Sotiris Avatar answered Dec 30 '22 20:12

Sotiris


Is your doctype set to put the browser in standards mode? For example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" 
"http://www.w3.org/TR/html4/strict.dtd">
like image 33
Keltex Avatar answered Dec 30 '22 20:12

Keltex