Forum Moderators: open

Message Too Old, No Replies

Charset meta tags with "space slash" at the end?

         

Dexie

10:39 am on Dec 19, 2004 (gmt 0)

10+ Year Member



Hi all,

I have this in my code:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

But I see in some pages, they have this:

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

Does anyone have any thoughts on it?

Sev.

Span

11:10 am on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dexie,
" /> is used on self-closing tags in XHTML. Tags like <img>, <br>, <input> must have a slash at the end. The space in front of it is not required, but recommended for compliance with older browsers.
Also, in XHTML, all tags and attributes should be written in lowercase.

Dexie

11:43 am on Dec 19, 2004 (gmt 0)

10+ Year Member



Hi Span,

Many thanks for that interesting info, I wasn't aware of it before.

So does that mean that all of these below are absolutely correct?

<meta name="Content-Language" content="en" />

<table class="example" />

<a "http://www.example.com/" />

Sev.

Span

11:54 am on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi,

No.. only 'empty tags', tags that don't have a closing tag need the slash at the end.
<img /> <br /> <input /> <meta /> <link />

Tags like <table> and <a> should be closed with their own closing tags </table>, </a>.

If you want to read up on XHTML (there's more to it), try a tutorial like this one: [w3schools.com ]

Dexie

12:07 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Many thanks Span, will take a look there. So much to learn ;-)

Sev.

Dexie

1:37 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



Just noticed on that website, it mentions this below:

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

Use this when you need to take advantage of HTML's presentational features and when you want to support browsers that don't understand Cascading Style Sheets.

I would really like to use strict and I have css, does this mean that it won't be compatible with some browsers?

Sev.

Robin_reala

9:02 pm on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Only very old ones like Netscape 4. Unless you have a pressing need it's not really worth worrying about them. If you want, there are ways of making sure they don't receive any CSS but still receive the content.

Dexie

10:56 pm on Dec 19, 2004 (gmt 0)

10+ Year Member



How would you do that then?

Sev.

Robin_reala

11:45 pm on Dec 19, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For NS4 use the import statement inside a style element instead of a link element. Not sure about IE4.

Dexie

5:06 pm on Dec 20, 2004 (gmt 0)

10+ Year Member



Ok, many thanks for the useful help. How comes there's always so much to learn ;-)

Sev.

bloke in a box

10:52 am on Dec 21, 2004 (gmt 0)

10+ Year Member



Where's the best place to search for information on how much the likes of IE4 / NS4 are still used?

Dexie

11:12 am on Dec 21, 2004 (gmt 0)

10+ Year Member



Have you got any stats for your site? They will give you some good figures to work on.

Sev.

Span

11:14 am on Dec 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a good place: [thecounter.com ]
But you have to look at the stats of the site you are writing code and CSS for first.

Robin_reala

1:06 pm on Dec 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Dexie, answering your earlier question about not serving to NS4/IE4, here's how:

[dithered.com ]

Dexie

1:26 pm on Dec 21, 2004 (gmt 0)

10+ Year Member



Many thanks Robin, Definitely bookmarked that one.
The more I learn, the more I realise, I've got more to learn ;-)

Sev.