Verwijderd schreef op 14 maart 2004 @ 17:43:
Een DIV strekt zich automatisch in de breedte. Dus comment hierboven slaat nergens op. Daarnaast is de gekozen centreer methode nou niet echt de beste...
Theoretisch kun je het HTML element een background geven. Welke dan op de viewport gezet wordt en het BODY element. Aantal browsers ondersteund dat ook, maar IE niet.
Dus voor IE zet je 1 background op het BODY element, gebruik makend van de code die ik eerder heb gegeven. 'fixed' werkt alleen correct op het BODY element in IE, dus dat kun je ook maar beter vergeten.
In het BODY element zet je dus een DIV, daarin komt je content en de DIV geef je het tweede achtergrondplaatje.
Als het nu nog steeds niet werkt, geef dan even een URI, zodat we even kunnen zien wat je precies fout doet.
Ik heb het inmiddels opgelost, de url is:
http://www.xs4all.nl/~djh/zomaar/index.html
De 3 div's naast elkaar gaan in elkaar op als het scherm kleiner wordt gemaakt zag ik net, dit is nou niet echt praktisch! Ik denk dat ik dan px moet gebruiken ipv %
En die marge class werkt ook niet, maar daar moet ik nog even naar kijken..
Het externe css bestand is:
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
| body
{
background-image: url("http://www.xs4all.nl/~djh/zomaar/img/back2.jpg");
background-attachment: absolute;
background-position: top center;
background-repeat: repeat-y;
scrollbar-3dlight-color: #C9CBB6;
scrollbar-arrow-color: #817E6D;
scrollbar-base-color: #ffffff;
scrollbar-darkshadow-color: #ffffff;
scrollbar-face-color: #E1E1E1;
scrollbar-highlight-color: #ffffff;
scrollbar-shadow-color: #817E6D;
background-color: #FFFFFF;
font-family: verdana;
font-size: 10px;
margin-bottom: 0px;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
}
div#header1
{
background-image: url("http://www.xs4all.nl/~djh/zomaar/img/header1.jpg");
background-attachment: absolute;
background-position: top center;
background-repeat: no-repeat;
width: 100%;
height: 100%;
z-index:2;
}
div#bottom1
{
position:absolute;
background: #E8E8E8;
bottom:0;
left:50%;
width:800px;
margin-left:-400px;
text-align: center;
}
div#contentl
{
position:absolute;
background: #E8E8E8;
top:295px;
left:25%;
width:150px;
height:350px;
margin-left:-75px;
border-style: solid;
border-width: 0px 1px 1px 1px;
}
div#contentl2
{
position:absolute;
background: #969696;
top:280px;
left:25%;
width:150px;
height:15px;
margin-left:-75px;
border-style: solid;
border-width: 1px 1px 1px 1px;
font-weight: bold;
}
div#contentm
{
position:absolute;
background: #E8E8E8;
top:295px;
left:50%;
width:450px;
height:350px;
margin-left:-225px;
border-style: solid;
border-width: 0px 1px 1px 1px;
}
div#contentm2
{
position:absolute;
background: #969696;
top:280px;
left:50%;
width:450px;
height:15px;
margin-left:-225px;
border-style: solid;
border-width: 1px 1px 1px 1px;
font-weight: bold;
}
div#contentr
{
position:absolute;
background: #E8E8E8;
top:295px;
left:75%;
width:150px;
height:350px;
margin-left:-75px;
border-style: solid;
border-width: 0px 1px 1px 1px;
}
div#contentr2
{
position:absolute;
background: #969696;
top:280px;
left:75%;
width:150px;
height:15px;
margin-left:-75px;
border-style: solid;
border-width: 1px 1px 1px 1px;
font-weight: bold;
}
div#contentu
{
position:absolute;
background: #E8E8E8;
top:675px;
left:50%;
width:780px;
height:250px;
margin-left:-390px;
border-style: solid;
border-width: 0px 1px 1px 1px;
}
div#contentu2
{
position:absolute;
background: #969696;
top:660px;
left:50%;
width:780px;
height:15px;
margin-left:-390px;
border-style: solid;
border-width: 1px 1px 1px 1px;
font-weight: bold;
}
div#water
{
position: absolute;
top:325px;
left:50%;
width:200px;
height:200px;
margin-left:-100px;
}
div.marges
{
margin-bottom: 5px;
margin-top: 5px;
margin-left: 5px;
margin-right: 5px;
{ |
Dit werkt in ieder geval, maar is dit een correcte manier? Commentaar zeer welkom!
[
Voor 5% gewijzigd door
DJH op 14-03-2004 19:04
]