Jump to content

html doctypes?


friedice

Recommended Posts

im having a slight problem with a website

pages doesnt seem to follow the fonts and fonts size specified in the css file but works fine with others like background color

could it be the doctype im using?

ive been using XHTML 1.0 Strict all along for all pages even with others in other directories

should i change all pages to XHTML 1.0 Transitional?

Link to comment
Share on other sites

Your doctype (which I assume is valid) has little to do with this.

 

The problem is your code (css). There are 2 errors in it.

 

first: grey is not a valid color

 

second:you need to assign a font, by using font-family and by enclosing it in " " like

 

font-family:"Maiandra GD";

 

If you have troubles with your code a good practise is to run it through the W3jigsaw: http://jigsaw.w3.org/css-validator/#validate_by_input

besides that a decent editor would already marked those those errors saving you quite some time (netbeans for instance would do that)

Link to comment
Share on other sites

the font does not need to be encased in double quotes..

Family names containing whitespace should be quoted. If quoting is omitted, any whitespace characters before and after the name are ignored and any sequence of whitespace characters inside the name is converted to a single space.

 

note this is a warning not an error (warnings do  have a purpose though)

Link to comment
Share on other sites

XHTML 1.0 Strict

 

This DTD contains all HTML elements and attributes, but does NOT INCLUDE presentational or deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML.

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

 

XHTML 1.0 Transitional

 

This DTD contains all HTML elements and attributes, INCLUDING presentational and deprecated elements (like font). Framesets are not allowed. The markup must also be written as well-formed XML.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

 

XHTML 1.0 Frameset

 

This DTD is equal to XHTML 1.0 Transitional, but allows the use of frameset content.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">

 

i think your problem is solved now..

also do  little change #content {

width :798px;

padding:20px;

background-color:white;

color:grey;

font-family:"Maiandra GD";

font-size:12px;}

Link to comment
Share on other sites

its not a whole new language, its just got new stuff. so some browsers support it better than others, but they can all do it, using www.html5test.com you can see how well, and guess what, IE comes last in the list!!

 

haha of course IE comes last, so it should.

i was thinking more abouot about the doctype.

 

if i just did <!DOCTYPE html>, this will work  even if i don't use the "new" features of html5.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.