Site crasht na toevoegen doctype

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior, Medior and Junior SAP HANA Developer

Vacature details Vakgebied: Software/IT Opleiding: Medior Werklocatie: Veldhoven Vacature ID: 12696 Introductie Our client is the world's leading provider of lithography systems for the semiconductor industry, manufacturing complex machines that are critical to the production of integrated circuits or chips. Our purpose is “unlocking the potential of people and society by pushing technology to new limits”. We do this guided by the principles “Challenge”, “Collaborate” and “Care”. Wat verwachten we van jou? SAP Certified Application Associate - SAP HANA Cloud Modeling (training and/or certification) Bachelor degree or higher Excellent understanding of SAP HANA (2.0 / Cloud), Data Modelling and writing

Bekijk vacature »

Dalando De Zuil

Dalando De Zuil

22/09/2010 16:43:31
Quote Anchor link
Nu heb ik deze prachtige, bijna HTML 4.01 Strict valid, pagina:

Afbeelding

Maar als ik dit lijntje toevoeg:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">


Dan krijg ik dit:

Afbeelding

Wat is er hier boem gegaan?

(en dit is in alle browsers zo, in ieder geval in IE, Firefox, en Chrome)
 
PHP hulp

PHP hulp

18/04/2024 17:13:00
 
Jonathan de Vries

Jonathan de Vries

22/09/2010 16:47:47
Quote Anchor link
Geef eerst eens wat gerelateerde code, op deze manier kunnen wij ook niet zien wat er fout gaat...
 
Jasper DS

Jasper DS

22/09/2010 16:48:10
Quote Anchor link
misschien iets met je css? of je kan misschien deze lijn gebruiken:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
TJVB tvb

TJVB tvb

22/09/2010 16:51:05
Quote Anchor link
Dan hou je jezelf niet aan de HTML specificaties terwijl je de browser met het doctype verplicht om die te gebruiken.
 
Dalando De Zuil

Dalando De Zuil

22/09/2010 16:53:03
Quote Anchor link
en de code:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Naam</title>
<style type="text/css">
body {
    background-color:#000066;
    color:white;
    font-size: 12px;
    font-family: Arial,Verdana,Tahoma,Helvetica;
    text-align:center;
}

#main {
    width:800px;
    border:2px solid #000088;
}

hr.sitebalk {
    color:#000088;
}

a.menubutton {
    width:180px;
    display:inline;
    border:1px solid #00004B;
    text-decoration:none;
    color:white;
    background-color:#000066;
}

a.menubutton:hover {
    background-color:#00004B;
}

div.menu {
    background-color:#00004B;
}

h1.header1 {
    display:block;
}
</style>
</head>
<body>
<div id="main">
<h1 class="header1">Naam</h1>
    <h3>ondertitel</h3>
    <hr class="sitebalk">
    <div class="menu">
        <p>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
        </p>
    </div>
    <hr class="sitebalk">
    <p style="text-align:left; margin:12px;">

        CONTENT

    </p>
</div>
<p>
    <a href="http://validator.w3.org/check?uri=referer">
        <img src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01 Strict" height="31" width="88" style="border:none;">
    </a>
    <a href="http://jigsaw.w3.org/css-validator/check/referer">
        <img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" style="border:none;">
    </a>
</p>
</body>
</html>
 

22/09/2010 17:06:16
Quote Anchor link
Je site zal in quirksmode worden gerenderd zonder doctype. Gebruik daarom ook doctype bij development.
 
Dalando De Zuil

Dalando De Zuil

22/09/2010 20:09:34
Quote Anchor link
Okay, leuk voor de volgende keer. Hoe kan ik het fixen?
 
Marc rc is as

Marc rc is as

22/09/2010 20:13:56
Quote Anchor link
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 

22/09/2010 20:17:32
Quote Anchor link
Marc rc is as op 22/09/2010 20:13:56:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>


En wat zou dat moeten doen?

Dalando: Opnieuw beginnen. Terug lopen en kijken tot waar het goed gaat.
 
Marc rc is as

Marc rc is as

22/09/2010 20:23:27
Quote Anchor link
Quote:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>


En wat zou dat moeten doen?


Excuus, daar hoorde die doctype nog boven natuurlijk.

Doe dit en het staat weer in het midden.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
#main {
    width:800px;
    border:2px solid #000088;
        float: none;
        margin: auto;
        padding: auto;
}
 
Dalando De Zuil

Dalando De Zuil

23/09/2010 19:36:07
Quote Anchor link
Okay, hij staat weer in het midden, nou alleen nog mijn menu! Het lijkt maar alsof de width niet werkt!

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
a.menubutton {
    width:180px;
    display:inline;
    border:1px solid #00004B;
    text-decoration:none;
    color:white;
    background-color:#000066;
}

a.menubutton:hover {
    background-color:#00004B;
}

===============================

        <p>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
            <a class="menubutton" href="#">Menu</a>
        </p>


Btw, mijn code is nu naar xHTML, nogsteeds het menu probleem :(
Gewijzigd op 23/09/2010 19:58:16 door Dalando De Zuil
 
Marc rc is as

Marc rc is as

23/09/2010 21:51:14
Quote Anchor link
Met width maak je de knoppen groter, dat is zo te zien niet wat jij wil.
Je zult moeten werken met padding en margin.

Je moet er wat mee spelen, maar dit is 'n oplossing.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
div.menu {
    text-align:center;
    background-color:#00004B;
}

a.menubutton {
    text-align: left;
    width:180px;
    display:inline;
    border:1px solid #00004B;
    text-decoration:none;
    color:white;
    background-color:#000066;
    padding-right: 60px;
    padding-left: 60px;        
}


Overigens een tip om een div die maar 1 keer voorkomt op 'n pagina geen class te geven maar een id. Dat maakt het duidelijker voor je CSS.
Dus ik zou van div.menu gewoon #menu maken.

Zo ook "h1.header1" is vreemd. Je kunt h1 gewoon aanroepen. Dus:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
h1{
    display:block;
}


Waarom eigenlijk display:block??
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.