It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming HTML Forum

xhtml standard (w3c standard) and css

xhtml standard (w3c standard) and css

Postby OZZIE on Mon May 30, 2005 11:11 am

Hi I've made a page using xhtml and css/css2 and now Im trying to validate it. However I seam to fail the test because if I add:
Code: Select all
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

to the top of my page, the content is not presented correctly (in IE 6).
Now I can't figure out what I have done wrong, please help me, here is the code:

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

<html>
<head>
<title>Skogalund IT</title>
<link rel="stylesheet" type="text/css" href="micro.css" />
<style type="text/css">
div.content.news
{
border-style: dotted;
border-width: 1px;
margin-top: 10px;
margin-left: 50px;
width: 250;
height: 50px;
}
   div.content.news.date
   {
   font-weight: bold;
   border-bottom-style: dotted;
   border-bottom-width: 1px;
   }

div.content.newsmore
{
position: absolute;
border-style: dotted;
border-width: 1px;
width: 350;
height: 250px;
top: 36px;
left: 350px;
}
</style>
</head>

<body>
<div class="all">
   <div class="top">
      <h2>Skogalund IT</h2>
   </div>

   <div class="meny">
      <h4>
      Nyheter
      <a class="obj" href="">Koncept</a>
      <a class="obj" href="">Om oss</a>
      <a class="obj" href="">Kontakt</a>
      <a class="obj" href="admin.html">Admin</a>
      </h4>
   </div>

   <div class="content">
      <h4>
      <br />
      <br />
         <div class="news">
            <div class="date">2005-05-26</div>
            3 Sidan uppdaterad.
         </div>

         <div class="news">
            <div class="date">2005-05-26</div>
            2 Sidan uppdaterad.
         </div>

         <div class="news">
            <div class="date">2005-05-26</div>
            1 Sidan startad! <a href="">Läs mer</a>
         </div>

         <div class="newsmore">
            ...mer info...
         </div>
      </h4>
</div>

</div>
</body>
</html>

micro.css
Code: Select all
body
{
background-color: white;
font-family: verdana;
}

div.all
{
border-style: dashed;
border-width: 0px;
margin-top: 20px;
margin-left: 10px;
}

div.top
{
border-style: ridge;
border-width: 5px;
width: 800px;
padding-left: 10px;
}

div.meny
{
border-style: outset;
border-width: 3px;
margin-top: 40px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
width: 800px;
}
   a.meny.obj
   {
   margin-left: 10%;
   }

div.content
{
border-style: dashed;
border-width: 2px;
margin-top: 10px;
padding: 0px;
width: 800px;
height: 400px;
overflow: auto;
}   

h1 { font-weight: bold; font-size: 42 px; padding: 0px; margin: 0 px;}
h2 { font-weight: bold; font-size: 36 px; padding: 0px; margin: 0 px;}
h3 { font-weight: bold; font-size: 24 px; padding: 0px; margin: 0 px;}
h4 { font-weight: bold; font-size: 14 px; padding: 0px; margin: 0 px;}
h5 { font-weight: bold; font-size: 12 px; padding: 0px; margin: 0 px;}
h6 { font-weight: bold; font-size: 10 px; padding: 0px; margin: 0 px;}
OZZIE
 
Posts: 4
Joined: Mon May 30, 2005 11:02 am

Postby webmaster on Mon May 30, 2005 11:25 am

Hi and welcome to DEVPPL

Just because a code validates doesen't mean it will work. It will probably work in Opera and FireFox, but not in IE. I don't know what's wrong, but you have to test and se what will work. Its progrably just to add a margin: 0; somewhere or something like that.

Some people use different CSS-files for the different browsers, maybe you can do that. (not recommended, try to figure out what's wrong instead.)
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby OZZIE on Mon May 30, 2005 11:29 am

webmaster wrote:Just because a code validates doesen't mean it will work.

I never said it validates, I said that it --doesn't-- seam to validate!
But thx.
OZZIE
 
Posts: 4
Joined: Mon May 30, 2005 11:02 am

Postby webmaster on Mon May 30, 2005 11:42 am

Ops, missed that (tired) :D

Remove the first <h4> and the last </h4> and I think it should work just fine.
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby OZZIE on Mon May 30, 2005 12:43 pm

Can you be more specific? I tried removing all <h4>s and </h4>s but with no better result... Are u actually trying out your suggestions before posting them?
OZZIE
 
Posts: 4
Joined: Mon May 30, 2005 11:02 am

Postby webmaster on Mon May 30, 2005 1:06 pm

That was strange, it works for me (yes I've tested it)

Page:
http://194.236.69.84/test7.php

Validationresult:
http://validator.w3.org/check?verbose=1 ... /test7.php
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby webmaster on Mon May 30, 2005 6:46 pm

The link I posted is on my own webserver, I will reinstall it, so it will be down for some hours. But here's the code:

test7.php:
Code: Select all
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html>
<head>
<title>Skogalund IT</title>
<link rel="stylesheet" type="text/css" href="micro.css" />
<style type="text/css">
div.content.news
{
border-style: dotted;
border-width: 1px;
margin-top: 10px;
margin-left: 50px;
width: 250;
height: 50px;
}
   div.content.news.date
   {
   font-weight: bold;
   border-bottom-style: dotted;
   border-bottom-width: 1px;
   }

div.content.newsmore
{
position: absolute;
border-style: dotted;
border-width: 1px;
width: 350;
height: 250px;
top: 36px;
left: 350px;
}
</style>
</head>

<body>
<div class="all">
   <div class="top">
      <h2>Skogalund IT</h2>

   </div>

   <div class="meny">
      <h4>
      Nyheter
      <a class="obj" href="">Koncept</a>
      <a class="obj" href="">Om oss</a>
      <a class="obj" href="">Kontakt</a>

      <a class="obj" href="admin.html">Admin</a>
      </h4>
   </div>

   <div class="content">

      <br />
      <br />
         <div class="news">

            <div class="date">2005-05-26</div>
            3 Sidan uppdaterad.
         </div>

         <div class="news">
            <div class="date">2005-05-26</div>
            2 Sidan uppdaterad.
         </div>

         <div class="news">

            <div class="date">2005-05-26</div>
            1 Sidan startad! <a href="">Läs mer</a>
         </div>

         <div class="newsmore">
            ...mer info...
         </div>

</div>

</div>
</body>
</html>


micro.css:
Code: Select all
body
{
background-color: white;
font-family: verdana;
}

div.all
{
border-style: dashed;
border-width: 0px;
margin-top: 20px;
margin-left: 10px;
}

div.top
{
border-style: ridge;
border-width: 5px;
width: 800px;
padding-left: 10px;
}

div.meny
{
border-style: outset;
border-width: 3px;
margin-top: 40px;
padding-top: 10px;
padding-bottom: 10px;
padding-left: 10px;
width: 800px;
}
   a.meny.obj
   {
   margin-left: 10%;
   }

div.content
{
border-style: dashed;
border-width: 2px;
margin-top: 10px;
padding: 0px;
width: 800px;
height: 400px;
overflow: auto;
}   

h1 { font-weight: bold; font-size: 42 px; padding: 0px; margin: 0 px;}
h2 { font-weight: bold; font-size: 36 px; padding: 0px; margin: 0 px;}
h3 { font-weight: bold; font-size: 24 px; padding: 0px; margin: 0 px;}
h4 { font-weight: bold; font-size: 14 px; padding: 0px; margin: 0 px;}
h5 { font-weight: bold; font-size: 12 px; padding: 0px; margin: 0 px;}
h6 { font-weight: bold; font-size: 10 px; padding: 0px; margin: 0 px;}
Make sure to check out our TNX Review and Link Vault Review
User avatar
webmaster
Site Admin
 
Posts: 2695
Joined: Tue Aug 17, 2004 1:07 pm
Location: Sweden

Postby OZZIE on Tue May 31, 2005 10:14 am

Ok, damn microsoft can't do shit right...
OZZIE
 
Posts: 4
Joined: Mon May 30, 2005 11:02 am

Postby ReFredzRate on Tue May 31, 2005 12:47 pm

OZZIE wrote:Ok, damn microsoft can't do shit right...

We already knew that didn't we? :roll:
ReFredzRate
1000+ Club
 


Who is online

Users browsing this forum: No registered users and 7 guests