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.

Specifying the Doc Type

Featured Replies

I'm a little confused as to what I should be adding as the Doctype declaration for my website?

 

At the moment I have only the below declaration at the top of each html file:

 

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

 

....followed by by

 

<html>

<head>

<title>Page Title</title>

<head>

<body>

Etc...

 

 

Should I be adding anything else?

No, that's good for a standard XHTML document. You could go a little further and include a bit more meta data though:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>

 

Personally, I'd recommend moving over to HTML5 instead though.

No, that's good for a standard XHTML document. You could go a little further and include a bit more meta data though:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>

 

Personally, I'd recommend moving over to HTML5 instead though.

 

Not could, should - XHTML must always have an XML namespace.

  • Author

No, that's good for a standard XHTML document. You could go a little further and include a bit more meta data though:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>

 

 

Ok thanks!

After posting I looked at a few sites soure code and added this:

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

 

I've changed the part in bold to charset=utf-8.

Out of curiosity, whats the difference?

 

+1 for your help.

 

Personally, I'd recommend moving over to HTML5 instead though.

 

Will definitely be looking into it, once i figure out everything else :ph34r:

  • Author

Not could, should - XHTML must always have an XML namespace.

 

thank you, added.

+1

Ok thanks!

After posting I looked at a few sites soure code and added this:

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

 

I've changed the part in bold to charset=utf-8.

Out of curiosity, whats the difference?

 

ISO-8859-1 is the charset for Latin Alphabet Part 1, which generally means all the characters you can see on your keyboard if you look down. It's designed for websites that display languages you can type on a "Western" keyboard (such as English, French, German, etc...). There are different versions of it for the various languages with different characters such as ISO-8859-6 for Arabic or ISO-8859-7 for Greek.

 

UTF-8 is a more modern character encoding. It's designed to be a universal character set that covers all languages and character types, replacing the need for numerous ISO-8859 types.

  • Author

I had to change one of my webpage doc type declarations which had a google map embedded to:

 

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

 

Without this change I got an error reading the document from an HTML validator.

 

Can you have several meta data tags?

 

eg:

 

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

More?

 

If so, do they need to be in any particular order?

I had to change one of my webpage doc type declarations which had a google map embedded to:

 

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

 

Without this change I got an error reading the document from an HTML validator.

 

Can you have several meta data tags?

 

eg:

 

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

More?

 

If so, do they need to be in any particular order?

 

Nope, you should only be using one meta charset.

 

ISO-8859-1 is still okay to use for your site. UTF-8 is arguably better but there's no rule saying you have to use it. It's your choice.

 

Bit odd that a Google Map is kicking out validation errors like that. I assume there must be some funky characters in the URL for it that UTF-8 doesn't recognise.

I think charset=iso-8859-1 is now out of date. I use utf-8 now.

 

However, as you found out, the validator http://validator.w3.org/ does raise errors with utf-8 if it sees certain characters like £ or = or & or some others. If this is the case, use the character codes from here:-

http://www.tedmontgomery.com/tutorial/HTMLchrc.html

and then it will validate.

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.