| View previous topic :: View next topic |
| Author |
Message |
OZZIE
Joined: 30 May 2005 Posts: 4
|
Posted: Mon May 30, 2005 12:11 pm Post subject: xhtml standard (w3c standard) and css |
|
|
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 |
|
 |
|
|
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3620 Location: Sweden
|
Posted: Mon May 30, 2005 12:25 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
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 |
|
 |
OZZIE
Joined: 30 May 2005 Posts: 4
|
Posted: Mon May 30, 2005 12:29 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
| 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 |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3620 Location: Sweden
|
Posted: Mon May 30, 2005 12:42 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
Ops, missed that (tired)
Remove the first <h4> and the last </h4> and I think it should work just fine. |
|
| Back to top |
|
 |
OZZIE
Joined: 30 May 2005 Posts: 4
|
Posted: Mon May 30, 2005 1:43 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
| 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 |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3620 Location: Sweden
|
|
| Back to top |
|
 |
webmaster Site Admin

Joined: 17 Aug 2004 Posts: 3620 Location: Sweden
|
Posted: Mon May 30, 2005 7:46 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
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 |
|
 |
OZZIE
Joined: 30 May 2005 Posts: 4
|
Posted: Tue May 31, 2005 11:14 am Post subject: Re: xhtml standard (w3c standard) and css |
|
|
| Ok, damn microsoft can't do shit right... |
|
| Back to top |
|
 |
ReFredzRate 1000+ Club

Joined: 20 Aug 2004 Posts: 2186 Location: Netherlands
|
Posted: Tue May 31, 2005 1:47 pm Post subject: Re: xhtml standard (w3c standard) and css |
|
|
| OZZIE wrote: |
| Ok, damn microsoft can't do shit right... |
We already knew that didn't we?  |
|
| Back to top |
|
 |
|