[SOLVED] Doctypes and CSS Headache

This is a discussion on "[SOLVED] Doctypes and CSS Headache" within the Web Page Design section. This forum, and the thread "[SOLVED] Doctypes and CSS Headache are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 11th, 2007, 14:08
New Member
Join Date: Sep 2007
Location: England
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thumbs down [SOLVED] Doctypes and CSS Headache

Ok here is the code:

Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>
        <title>Sitemap</title>
        <style type="text/css" media="all">
            ul#map { list-style:disc; }
            ul#map li.0 { margin-left:0px;  font-size: 12pt; font-weight: bold }
            ul#map li.1 { margin-left: 1cm; font-size: 11pt }
            ul#map li.2 { margin-left: 2cm; font-size: 10pt }
            ul#map li.3 { margin-left: 3cm; font-size: 8Pt }
            ul#map li.4 { margin-left: 4cm; font-size: 8Pt }
            ul#map li.5 { margin-left: 5cm; font-size: 8Pt }
        </style>
    </head>
    <body>
        <ul id="map">
            <li class="0"><a href="/index.php">Home</a></li>
            <li class="1"><a href="/pageone.php">Page 1</a></li>
            <li class="2"><a href="/pagetwo.php">Page 2</a></li>
            <li class="3"><a href="/pagethree.php">Page 3</a></li>
            <li class="4"><a href="/pagefour.php">Page 4</a></li>
            <li class="5"><a href="/pagefive.php">Page 5</a></li>
        </ul>
    </body>
</html>
Any ideas why this displays fine with the doctype tag taken out? How can I keep the same doctype but display it correctly? Any thoughts?

Thanks in advance, this is driving me loopy...

Jen
Reply With Quote

  #2 (permalink)  
Old Sep 11th, 2007, 14:29
SuperMember

SuperMember
Join Date: May 2007
Location: UK
Age: 27
Posts: 1,111
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Doctypes and CSS Headache

Quote:
Originally Posted by Jenski View Post
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
Any ideas why this displays fine with the doctype tag taken out? How can I keep the same doctype but display it correctly? Any thoughts?
You have two problems: a specific problem right now, and a more dangerous general problem.

The specific problem is the following validation error: Line 2, Column 48: there is no attribute "lang". Remove your code lang="en" and it should work (or you might get a new error).

The more general problem is that you're obviously clueless about Doctypes and validation. I don't mean that as an insult -- you need to understand that XHTML is not forgiving. If you do something wrong in XHTML then your site will break.

Read my article about Doctypes to get a proper understanding of all the complexities.

I recommend you switch to HTML 4.01 Strict. At the very least, stop using XHTML 1.1, and change to XHTML 1.0 Strict. Just because 1.1 is "the latest" doesn't make it a wise choice. In almost every case, XHTML 1.1 is a sign of someone who doesn't know what he's doing.
Reply With Quote
  #3 (permalink)  
Old Jan 14th, 2008, 10:47
New Member
Join Date: Sep 2007
Location: England
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Doctypes and CSS Headache

It turns out that if I used letters instead of numbers it works fine... ;-)

As in:
Quote:
<ul id="map">
<li class="one"><a href="/index.php">Home</a></li>
<li class="two"><a href="/pageone.php">Page 1</a></li>
<li class="three"><a href="/pagetwo.php">Page 2</a></li>
...
Reply With Quote
  #4 (permalink)  
Old Jan 17th, 2008, 07:30
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Doctypes and CSS Headache

Which one is your question? Your Doctype or your CSS problem?
We don't recommend to give your CSS class name in numbers!
What error message you get when you use numbers instead of letters?
Last Blog Entry: ASP Programming Tips and Technique (Oct 26th, 2007)
Reply With Quote
Reply

Tags
css, doctypes

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with understanding DOCTYPES in Dreamweaver! bellabella Web Page Design 1 May 16th, 2008 22:42
[SOLVED] Help please! Headache. Bravo81 Search Engine Optimization (SEO) 16 Jan 24th, 2008 10:26
Straw Poll - Doctypes matelot Web Page Design 7 Jul 21st, 2007 17:24
Doctypes, IE6, scrolling content matelot Web Page Design 0 Jul 2nd, 2007 19:34
Another CSS Headache... a big one! mattlowe81 Web Page Design 2 Apr 17th, 2006 12:16


All times are GMT. The time now is 19:04.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

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