[CSS] IE houdt zich niet aan margin-right

Pagina: 1
Acties:
  • 118 views sinds 30-01-2008
  • Reageer

  • RHE123
  • Registratie: April 2003
  • Laatst online: 17:34
IE houdt zich niet aan de margin-right die ik aan een div heb meegegeven. De bedoeling is dus dat een divje van 20px van links naar 20px van rechts loopt. IE kapt het divje echter direct af na de inhoud, dus de div is veel te smal! FF doet dit alles wel goed! Het gaat dus om de header en de footer div's.

Een stukje html:
HTML:
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
<div id="login_header">
    [img]"images/logo.gif"[/img]
    <h1>Baarnsch Lyceum Internet Opslag Systeem (BLIOS)</h1>
</div>
<div id="login_info">
    <div id="login_login">
    <h2>Aanmelden bij BLIOS</h2>
        <form action="BLIOS.php?task=login" method="POST">

        <table>
            <tr>
                <th><label for="username">Gebruikersnaam:</label></th>
                <td><input type="text" name="username" id="username"></td>
            </tr>
            <tr>
                <th><label for="pass">Wachtwoord:</label></th>
                <td><input type="password" name="pass" id="pass"></td>

            </tr>
            <tr>
                <td>&nbsp;</td>
                <td><input type="submit" name="submit" value="Aanmelden"></td>
            </tr>
        </table>
    </form>
            </div>
    <div id="login_links">

        <ul>
            <li><a href="#">Meer over BLIOS</a></li>
            <li><a href="http://www.baarnschlyceum.nl/">Leerlingenwebsite</a></li>
            <li><a href="http://www.hetbaarnschlyceum.nl/">Schoolsite</a></li>
        </ul>
    </div>
</div>
<div id="login_uitleg">
Lange tekst
</div>

<div id="login_footer">
&copy;2004-2005 RHE - <a href="#">Gebruiksvoorwaarden</a>
</div>


Cascading Stylesheet:
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
html,body
{
  height:100%;
  margin:0;
  width: 100%;
}
/*LOGIN*/
#login_header {
    position: absolute;
    top: 10px;
    left: 20px;
    right: 20px;
    height: 50px;
}
#login_header img {
    float: left;
}
#login_header h1 {
    float: left;
    margin-left: 10px;
    margin-top: 10px;
}
#login_login {
    height: 150px;
    margin-right: 20px;
    margin-top: 80px;
    padding: 5px;
}
#login_login h2 {
    text-align: center;
}
#login_login table {
    padding-left: 20px;
}
#login_login th {
    text-align: right;
}
#login_login td {
    text-align: left;
}
#login_links {
    height: 150px;
    margin-top: 20px;
    margin-right: 20px;
    padding: 5px;
}
#login_info {
    float: right;
    width: 300px;
}
#login_uitleg {
    position: absolute;
    right: 320px;
    top: 80px;
    left: 20px;
    height: 370px;
    padding: 5px;
    overflow: auto;
}
#login_footer {
    position: absolute;
    top: 480px;
    left: 20px;
    right: 20px;
    height: 20px;
    text-align: center;
}
/*EIND LOGIN*/

[ Voor 19% gewijzigd door RHE123 op 25-06-2005 16:36 ]

Canon 1D X + 16-35 f/2.8L + 24-70 f/2.8L + 70-200 f/2.8L IS + 135 f/2.0L + 430EX II | iMac | MacBook Pro


  • crisp
  • Registratie: Februari 2000
  • Laatst online: 16:18

crisp

Devver

Pixelated

Welke div bedoel je precies?
Probeer sowieso absolute positioning zo veel mogelijk te vermijden als het niet nodig is.

Intentionally left blank


  • RHE123
  • Registratie: April 2003
  • Laatst online: 17:34
Oeps, helemaal vergeten :o 8)7 , het gaat om de header en de footer div's.

Hoe is dit eigenlijk het netst te doen? (zonder absolute positionering dus)

[ Voor 48% gewijzigd door RHE123 op 25-06-2005 16:38 ]

Canon 1D X + 16-35 f/2.8L + 24-70 f/2.8L + 70-200 f/2.8L IS + 135 f/2.0L + 430EX II | iMac | MacBook Pro


  • crisp
  • Registratie: Februari 2000
  • Laatst online: 16:18

crisp

Devver

Pixelated

ik denk dat dit al in de richting komt:
Cascading Stylesheet:
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
html,body
{
  height:100%;
  margin:0;
  width: 100%;
}
/*LOGIN*/
#login_header {
    margin-top: 10px;
    margin-left: 20px;
    margin-right: 20px;
    height: 50px;
}
#login_header img {
    float: left;
}
#login_header h1 {
    margin-left: 10px;
    margin-top: 10px;
}
#login_login {
    height: 150px;
    margin-right: 20px;
    margin-top: 20px;
    padding: 5px;
}
#login_login h2 {
    text-align: center;
}
#login_login table {
    padding-left: 20px;
}
#login_login th {
    text-align: right;
}
#login_login td {
    text-align: left;
}
#login_links {
    height: 150px;
    margin-top: 20px;
    margin-right: 20px;
    padding: 5px;
}
#login_info {
    float: right;
    width: 320px;
}
#login_uitleg {
    margin-top: 20px;
    margin-left: 20px;
    margin-right: 320px;
    height: 370px;
    padding: 5px;
    overflow: auto;
}
#login_footer {
    clear:both;
    margin-left: 20px;
    margin-right: 20px;
    height: 20px;
    text-align: center;
}
/*EIND LOGIN*/

:)

Intentionally left blank


  • RHE123
  • Registratie: April 2003
  • Laatst online: 17:34
THNX :>

Het werkt zo helemaal goed! Er zaten nog twee verspringingen in, maar dat waren gewoon een paar margins met verkeerde waardes, voor de rest klopte het helemaal! Hartstikke bedankt!

Canon 1D X + 16-35 f/2.8L + 24-70 f/2.8L + 70-200 f/2.8L IS + 135 f/2.0L + 430EX II | iMac | MacBook Pro