Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Novice needs help with doctype public code

Featured Replies

I have a problem with doctype public codes. I think the problem lies in the fact that I have used some of a template which was created on dreamweaver then added lots of extra code in basic html. Now whichever type of doctype public code I put in it won't open on my son's browser. If I put no doctype code in at all it will open perfectly on all modern browsers but on older browsers cuts off part of the link buttons at the top of the page - sort of squashes them up so only half can be seen. I created the website on iE8. Is there an answer to this problem? I have spent a lot of time on the website and don't really want to start from scratch. I am only familiar with html code not the up to date CSS/Dreamweaver. I had a website online for a couple of years several years ago created from scratch with html and put no doctype code on that and it opened perfectly in all browsers. Help please. Any suggestions will need simplifying - I am a novice with the more modern stuff

Thanks

 

The web address is www.unicorncottage.com - it is not finished yet I have just put it online so people could look at the code and maybe test out how it is working.

I have a problem with doctype public codes. I think the problem lies in the fact that I have used some of a template which was created on dreamweaver then added lots of extra code in basic html. Now whichever type of doctype public code I put in it won't open on my son's browser. If I put no doctype code in at all it will open perfectly on all modern browsers but on older browsers cuts off part of the link buttons at the top of the page - sort of squashes them up so only half can be seen. I created the website on iE8. Is there an answer to this problem? I have spent a lot of time on the website and don't really want to start from scratch. I am only familiar with html code not the up to date CSS/Dreamweaver. I had a website online for a couple of years several years ago created from scratch with html and put no doctype code on that and it opened perfectly in all browsers. Help please. Any suggestions will need simplifying - I am a novice with the more modern stuff

Thanks

 

The web address is www.unicorncottage.com - it is not finished yet I have just put it online so people could look at the code and maybe test out how it is working.

 

Hey,

 

Here's a list of doctypes:

 

http://www.javascriptkit.com/howto/doctype.shtml

So your telling me your website wont work if you insert this doctype?

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

 

In my opinion, your first problem was creating your website on IE8. IE is the nightmare of browsers and something that looks good in IE may look much different in Firefox, chrome, etc. You do have an odd problem though. It may be something simple or something complicated.

 

I'm using Firefox 5 and it looks fine to me except for an extra "br/>" at the bottom left of your page. I think you just forgot the "<" bracket to make it "<br/>".

 

It took me a while to get my website to look similar in IE & Firefox & others. Sometimes it takes some re-construction to get it to work properly which may be your case. That still doesn't explain the doctype problem though.

 

Try the above doctype I gave you and I'll pop back on and see if it's working or just post it to another url so I can take a look.

 

Thanks.

@urbanelementz aren't you the guy that was just asking about div wrappers? This is like deaf tryin' to help blind.

 

@bluemerle50 wtf is <!DOCTYPE HTML PUBLIC> ? This kind of doctype doesn't exist, but if you drop "public" you're gonna have yourself a HTML5 doctype. Also, you don't have an opening <html> tag and that's a serious violation. The rest of the code is of course a blasphemy, but you should be fine as long as you fix the errors I've pointed out. Oh yeah, and official list of doctypes is right here.

 

@Neverminder - Your kidding me right? Wow. Was my answer not up to par or something? Yea I was asking about wrappers but I'm not stupid. Just wanted to know if there was something I was missing. I know CSS and XHTML just fine but wanted to confirm with everyone. Have you ever had a question? Thanks for the insult. He's asking about a doctype. Nothing I can't handle.

 

@bluemerle50 - Neverminder is right. Sometimes it's the simplest things that get overlooked. I'm not sure if it was a bug or whatever but I used to use Dreamweaver and there were a few times it messed up my <html>, <head> and <body> tags. Add the <html> tag below your doctype and it should would work just fine. Good luck.

Edited by urbanelementz

I checked your page here

http://validator.w3.org/

and it gave two errors and one warning, but as said above, all are important, the missing <html> tag and the doctype.

Your page seems to be all XHTML so use either the Strict or Transitional XHTML doctype from here

http://www.w3.org/QA/2002/04/valid-dtd-list.html

and edit the br tag to <br/>

 

If IE8 still has a problem, come back to us. It looks OK on IE9 apart from the br tag.

 

Edit: You say that it looked OK before with no doctype. Sometimes you are lucky, but IE will operate in quirks mode. I've looked at your stylesheet and noticed float: left and margin-left in the same style:-

#content {
float: left;
width: 400px;
padding-left: 10px;
padding-top: 20px;
margin-left: 1px;
background: url(images/title_back.gif) repeat-x top;
}

 

IE6 will double the margin without a doctype if the margin is on the same side as the float, it's only 1px here but it might make a div too wide for its container and you may have done it somewhere else. A doctype should make browsers process the same way. If IE8 is still a problem with the correct doctype, then someone will have to look closer.

Edited by Wickham

Alright alright hold your pants on, all I was saying, that before you assume the teachers chair maybe you should do some more RTFM on the subject? Because take a look around and you're gonna see loads of wrong and inconsistent "advices" from "experts" that only make the people come back here and flood the forum with useless traffic. It's not my first rodeo, kid, I don't make false accusations.

 

By the way, I was young once too and learning stuff that you're tryin' to crack on now, but in order to not look stupid I read books on the subject. I understand that this might be out of the fashion these days, but it's still effective nonetheless.

 

It's all good man. I understand where you're coming from.

I checked your page here

http://validator.w3.org/

and it gave two errors and one warning, but as said above, all are important, the missing <html> tag and the doctype.

Your page seems to be all XHTML so use either the Strict or Transitional XHTML doctype from here

http://www.w3.org/QA/2002/04/valid-dtd-list.html

and edit the br tag to <br/>

 

If IE8 still has a problem, come back to us. It looks OK on IE9 apart from the br tag.

 

Edit: You say that it looked OK before with no doctype. Sometimes you are lucky, but IE will operate in quirks mode. I've looked at your stylesheet and noticed float: left and margin-left in the same style:-

#content {
float: left;
width: 400px;
padding-left: 10px;
padding-top: 20px;
margin-left: 1px;
background: url(images/title_back.gif) repeat-x top;
}

 

IE6 will double the margin without a doctype if the margin is on the same side as the float, it's only 1px here but it might make a div too wide for its container and you may have done it somewhere else. A doctype should make browsers process the same way. If IE8 is still a problem with the correct doctype, then someone will have to look closer.

 

+1 Nice digging.

  • Author

Hey,

 

Here's a list of doctypes:

 

http://www.javascriptkit.com/howto/doctype.shtml

So your telling me your website wont work if you insert this doctype?

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

 

In my opinion, your first problem was creating your website on IE8. IE is the nightmare of browsers and something that looks good in IE may look much different in Firefox, chrome, etc. You do have an odd problem though. It may be something simple or something complicated.

 

I'm using Firefox 5 and it looks fine to me except for an extra "br/>" at the bottom left of your page. I think you just forgot the "<" bracket to make it "<br/>".

 

It took me a while to get my website to look similar in IE & Firefox & others. Sometimes it takes some re-construction to get it to work properly which may be your case. That still doesn't explain the doctype problem though.

 

Try the above doctype I gave you and I'll pop back on and see if it's working or just post it to another url so I can take a look.

 

Thanks.

  • Author

I checked your page here

http://validator.w3.org/

and it gave two errors and one warning, but as said above, all are important, the missing <html> tag and the doctype.

Your page seems to be all XHTML so use either the Strict or Transitional XHTML doctype from here

http://www.w3.org/QA/2002/04/valid-dtd-list.html

and edit the br tag to <br/>

 

If IE8 still has a problem, come back to us. It looks OK on IE9 apart from the br tag.

 

Edit: You say that it looked OK before with no doctype. Sometimes you are lucky, but IE will operate in quirks mode. I've looked at your stylesheet and noticed float: left and margin-left in the same style:-

#content {
float: left;
width: 400px;
padding-left: 10px;
padding-top: 20px;
margin-left: 1px;
background: url(images/title_back.gif) repeat-x top;
}

 

IE6 will double the margin without a doctype if the margin is on the same side as the float, it's only 1px here but it might make a div too wide for its container and you may have done it somewhere else. A doctype should make browsers process the same way. If IE8 is still a problem with the correct doctype, then someone will have to look closer.

Thanks for your help. Will try that. You lost me with the 'float' etc. What do you suggest it should say?

 

thanks

 

You shouldn't have "float:left" and "margin-left:1px" ... try removing "margin-left:1px" ...

First things first, get that doctype sorted as mentioned above.

First things first, get that doctype sorted as mentioned above.

 

By the way... Roothost, I love your new logo. Looks great.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.