Html ERROR

Status
Niet open voor verdere reacties.

NeedForSpeed

Gebruiker
Lid geworden
17 jan 2008
Berichten
245
Hoi!

Ik heb een rare fout, de fout is; dat hij de image niet weergeeft.

Ik heb dit;

PHP:
<!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>Daemon ~ The generation coding!</title>
<link href="style.css" rel="stylesheet" type="text/css" media="all" />
</head>
<body>
<center>
<div id="header"></div>
<div id="navbar">
<a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Home&nbsp;&nbsp;&nbsp;&nbsp;|</a> 
<a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Portfolio&nbsp;&nbsp;&nbsp;&nbsp;|</a> 
<a href="#">&nbsp;&nbsp;&nbsp;&nbsp;About me&nbsp;&nbsp;&nbsp;&nbsp;|</a> 
<a href="#">&nbsp;&nbsp;&nbsp;&nbsp;Contact&nbsp;&nbsp;&nbsp;&nbsp;|</a> 
<a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
<b><font color=red>Follow us</font></b>&nbsp;  <img src="images/twitter.png" alt="Follow us on twitter!" width="15" height="15">&nbsp;  <img src="images/facebook.png" alt="Follow us on facebook!" width="15" height="15"></a> 
</div>
<div id="top"></div>
</center>

PHP:
*, outline { border:0; outline:none; }
a, a:active {
color: #C8C8C8 ;
text-decoration: none;
}

body
{
background-image: url(images/body.jpg);
background-repeat: repeat;
padding:0;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
color: #FFFFFF;
background-color: #FFFFFF;
}

#header
{
background-image: url(images/daemon_header.jpg);
background-repeat: no-repeat;
margin-top: 20px;
width: 1024px;
height: 178px;
}

#navbar
{
background-image: url(images/navbar.jpg);
background-repeat: no-repeat;
width: 1018px;
height: 45px;
margin-top: 5px;
font-size: 15px;
font-family: Arial;
text-align: left;
padding-top: 12px;
padding-left: 6px;
a, a:active {
text-color:#C8C8C8;
text-decoration: none;
}

#top
{
background-image: url(images/top.jpg);
background-repeat: no-repeat;
margin:0 auto;
height: 768px;
width: 1020px;
}

Als ik onder navbar een content wil plaatsen dus het tekst vak, geeft hij de image niet weer.
 
je <img> tag is niet gesloten terwijl je wel XHTML 1.0 transitional als doctype hebt. Volgens mij moet je in XHTML al je tags sluiten. Trouwens, als ik je html invoer in de validator geeft hij 16 errors, dus misschien moet je of eerst de fouten uit je html oplossen, of misschien een minder streng doctype kiezen. Vaak lossen dit soort problemen zichzelf dan op.
 
Mischien moet je eens ophouden met &nbsp'en. ;)

In ieder geval: hoe kan je in #$*%naam een xhtml doc maken, en toch nog durven <font> tags te gebruiken? Also, waar is je eind <body> en <html> tag?

probeer dit:
HTML:
<!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>Daemon ~ The generation coding!</title>

      <link href="style.css" rel="stylesheet" type="text/css" media="all" />

   </head>

   <body>

      <div id="header"></div>

      <div id="navbar">
         <a href="#">Home|</a>
         <a href="#">Portfolio|</a>
         <a href="#">About me|</a>
         <a href="#">Contact|</a>

         <span class='red'>Follow us</span>

         <img src="images/twitter.png" alt="Follow us on twitter!" width="15" height="15" />
         <img src="images/facebook.png" alt="Follow us on facebook!" width="15" height="15" />

      </div>


      <div id="top"></div>

   </body>
</html>
Ohja, en dus geen &nbsp's meer. Als je iets meer spaties wilt geven gebruik dan de CSS 'margin' en 'padding'.


Mischien ook handig: w3 validator...
 
De <center> tag hoor je trouwens ook niet meer te gebruiken (Vegras had hem in zijn voorbeeld al weggehaald maar ik noem het voor de volledigheid toch nog maar even). De vormgeving hoort door de CSS geregeld te worden, niet door de HTML. Ik weet niet waar je tot nog toe je informatie vandaan hebt gehaald maar ik stel voor dat je er wegblijft :)
 
Status
Niet open voor verdere reacties.
Terug
Bovenaan Onderaan