Flash Games
 FAQ   Search   Memberlist   Usergroups   Register  Profile   Log in to check your private messages   Log in 


xhtml standard (w3c standard) and css



 

Post new topic   Reply to topic  
   DEVPPL Forum Index -> HTML Forum
View previous topic :: View next topic  
Author Message
OZZIE



Joined: 30 May 2005
Posts: 4

PostPosted: Mon May 30, 2005 12:11 pm    Post subject: xhtml standard (w3c standard) and css Reply with quote

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:
<!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:
<!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:
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;}
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3593
Location: Sweden

PostPosted: Mon May 30, 2005 12:25 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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.)
Back to top
View user's profile Send private message Visit poster's website
OZZIE



Joined: 30 May 2005
Posts: 4

PostPosted: Mon May 30, 2005 12:29 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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.
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3593
Location: Sweden

PostPosted: Mon May 30, 2005 12:42 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

Ops, missed that (tired) Very Happy

Remove the first <h4> and the last </h4> and I think it should work just fine.
Back to top
View user's profile Send private message Visit poster's website
OZZIE



Joined: 30 May 2005
Posts: 4

PostPosted: Mon May 30, 2005 1:43 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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?
Back to top
View user's profile Send private message
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3593
Location: Sweden

PostPosted: Mon May 30, 2005 2:06 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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&uri=http%3A//194.236.69.84/test7.php
Back to top
View user's profile Send private message Visit poster's website
webmaster
Site Admin


Joined: 17 Aug 2004
Posts: 3593
Location: Sweden

PostPosted: Mon May 30, 2005 7:46 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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:
<!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:
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;}
Back to top
View user's profile Send private message Visit poster's website
OZZIE



Joined: 30 May 2005
Posts: 4

PostPosted: Tue May 31, 2005 11:14 am    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

Ok, damn microsoft can't do shit right...
Back to top
View user's profile Send private message
ReFredzRate
1000+ Club


Joined: 20 Aug 2004
Posts: 2186
Location: Netherlands

PostPosted: Tue May 31, 2005 1:47 pm    Post subject: Re: xhtml standard (w3c standard) and css Reply with quote

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

We already knew that didn't we? Rolling Eyes
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    DEVPPL Forum Index -> HTML Forum All times are GMT + 1 Hour
Page 1 of 1

 
 
Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User: Pass:
Log me on automatically each visit:

 


Powered by phpBB © 2001, 2005 phpBB Group - Modified by DEVPPL

Flash Games - Sitemap