Het probleem
De site is opgebouwd uit DIVs en hebben allemaal een vaste breedte. De breedte van de DIVjes staan in de CSS die hieronder te vinden is. FireFox, Opera en Netscapen laten de site perfect zijn. Alleen Internet Explorer laat het DIV "menu" een aantal pixels naar links zien (ook hieronder te zien, het gaat om het grijze vlak wat niet binnen het witte vlak blijft.). Zodra ik de padding van links en rechts wat lager zet is er geen probleem in IE en de andere sites laten de site ook perfect zien.
De DIV die belangrijk is, is "container". Deze is 600px breed met een padding links en rechts van 100px. Dus de content is 400px breed. Hierin zitten 2 DIVs ("menu" en "content"). "Menu" is 88px breed (6300 - (2*6px) links en rechts aan padding) en "content" is 288px breed (300 - (2*6px) links en rechts aan padding).
288 + 12 + 88 + 12 = 400px volgens alle browsers op IE na. Ik heb het één en ander geprobeerd met de margin en border op 0 te zetten, maar dit had geen resultaat.
Hoe is dit op te lossen in IE? Het liefst met de huidige paddings. De headers hebben in de verschillende browsers ook vershillende afstanden tot de bovenkant. Is dit ook een probleem geval?
Bronnen
Het probleem:

HHTML:
CSS:
Uitleg width in Internet Explorer

Klik
De site is opgebouwd uit DIVs en hebben allemaal een vaste breedte. De breedte van de DIVjes staan in de CSS die hieronder te vinden is. FireFox, Opera en Netscapen laten de site perfect zijn. Alleen Internet Explorer laat het DIV "menu" een aantal pixels naar links zien (ook hieronder te zien, het gaat om het grijze vlak wat niet binnen het witte vlak blijft.). Zodra ik de padding van links en rechts wat lager zet is er geen probleem in IE en de andere sites laten de site ook perfect zien.
De DIV die belangrijk is, is "container". Deze is 600px breed met een padding links en rechts van 100px. Dus de content is 400px breed. Hierin zitten 2 DIVs ("menu" en "content"). "Menu" is 88px breed (6300 - (2*6px) links en rechts aan padding) en "content" is 288px breed (300 - (2*6px) links en rechts aan padding).
288 + 12 + 88 + 12 = 400px volgens alle browsers op IE na. Ik heb het één en ander geprobeerd met de margin en border op 0 te zetten, maar dit had geen resultaat.
Hoe is dit op te lossen in IE? Het liefst met de huidige paddings. De headers hebben in de verschillende browsers ook vershillende afstanden tot de bovenkant. Is dit ook een probleem geval?
Bronnen
Het probleem:

HHTML:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Fourtyfive</title>
<link href="default.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"></div>
<div id="container">
<div id="menu">
<li><strong>Menu</strong></li>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
<li>Item 5</li>
<li>Item 6</li>
</div>
<div id="content">
<h1>Header 1</h1>
<h2>Header 2</h2>
<h3>Header 3</h3>
<p class="bold">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p class="italic">Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of "de Finibus Bonorum et Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, "Lorem ipsum dolor sit amet..", comes from a line in section 1.10.32.</p>
<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).</p>
<p>There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of Lorem Ipsum, you need to be sure there isn't anything embarrassing hidden in the middle of text. All the Lorem Ipsum generators on the Internet tend to repeat predefined chunks as necessary, making this the first true generator on the Internet. It uses a dictionary of over 200 Latin words, combined with a handful of model sentence structures, to generate Lorem Ipsum which looks reasonable. The generated Lorem Ipsum is therefore always free from repetition, injected humour, or non-characteristic words etc.</p>
</div>
<div id="footer"></div>
</div>
</body>
</html> |
CSS:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
| html, body {
margin: 0px;
padding: 0px;
border: 0px;
height: 100%;
background-image: url(background.jpg);
background-repeat: repeat;
background-position: top right;
background-color: #444;
font-family: "Trebuchet MS", Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #333333;
font-weight: normal;
line-height: 1.7em;
text-align: justify;
}
h1 {
font-size: 15px;
font-weight: bold;
text-transform: uppercase;
}
h2 {
font-size: 13px;
font-weight: bold;
text-transform: uppercase;
}
h3 {
font-size: 11px;
font-weight: bold;
text-transform: uppercase;
}
#header {
background-image: url(header.jpg);
background-position: top right;
background-repeat: no-repeat;
width: 600px;
height: 125px;
float: right;
clear: both;
}
#container {
background-image: url(container.jpg);
background-position: top right;
background-repeat: repeat-y;
width: 400px;
padding-right: 100px;
padding-left: 100px;
clear: both;
float: right;
}
#content {
width: 288px;
float: right;
clear: right;
padding: 2px 6px;
vertical-align: top;
}
p.bold {
font-weight: bold;
}
p.italic {
font-style: italic;
}
p.oblique {
font-style: oblique;
}
#footer {
text-align: center;
padding: 2px 6px;
width: 388px;
}
#menu {
background-color: #efefef;
width: 88px;
height: 250px;
float: left;
clear: left;
padding: 2px 6px;
}
li {
list-style-type: none;
list-style-position: outside;
line-height: 1.4em;
} |
Uitleg width in Internet Explorer

Klik
[ Voor 9% gewijzigd door Verwijderd op 22-11-2005 18:30 ]