friedice Posted May 1, 2011 Share Posted May 1, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/ Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 can i see a snippet of the css you are talking about? Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1208949 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 also, what browser are you using? Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1208950 Share on other sites More sharing options...
friedice Posted May 1, 2011 Author Share Posted May 1, 2011 #content { width :798px; padding:20px; background-color:white; color:grey; font:Maiandra GD; font-size:12px; using both chrome and ff Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1208956 Share on other sites More sharing options...
cssfreakie Posted May 1, 2011 Share Posted May 1, 2011 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) Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1209038 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 the font does not need to be encased in double quotes..but the main issue that i see is you "font:" in your css should be "font-family:" as cssfreakie stated Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1209043 Share on other sites More sharing options...
cssfreakie Posted May 1, 2011 Share Posted May 1, 2011 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) Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1209044 Share on other sites More sharing options...
fugix Posted May 1, 2011 Share Posted May 1, 2011 okay sorry you are right...font-families that do not contain whitespace do not need to be quoted...while ones that contain whitespace do...thanks freakie...my fault Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1209056 Share on other sites More sharing options...
diptiranjan Posted May 6, 2011 Share Posted May 6, 2011 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;} Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1211552 Share on other sites More sharing options...
spiderwell Posted May 9, 2011 Share Posted May 9, 2011 xhtml is the bandwagon, use html 5. *disclaimer this is an opinion* Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1213095 Share on other sites More sharing options...
Maknib Posted May 10, 2011 Share Posted May 10, 2011 xhtml is the bandwagon, use html 5. *disclaimer this is an opinion* is html5 supported in all browsers? Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1213147 Share on other sites More sharing options...
spiderwell Posted May 10, 2011 Share Posted May 10, 2011 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!! Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1213230 Share on other sites More sharing options...
Maknib Posted May 11, 2011 Share Posted May 11, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1213516 Share on other sites More sharing options...
spiderwell Posted May 11, 2011 Share Posted May 11, 2011 yup. and you can always run your page through the wc3 validator incase your not sure Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1213772 Share on other sites More sharing options...
friedice Posted May 13, 2011 Author Share Posted May 13, 2011 oo i fixed it forgot to put font-family lol thx Quote Link to comment https://forums.phpfreaks.com/topic/235255-html-doctypes/#findComment-1214911 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.