Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

quotes in ie and gecko

Status
Not open for further replies.

generlam

Programmer
Jun 13, 2001
75
0
0
US
I'm developing in HTML-Kit and get different results in IE and Gecko when viewing test using the <q> tag. Gecko displays quotes and italics, while IE only displays italic. Any way to make this consistent aside from <i>&quot; ?
 
How would I include &quot; in the css? CSS is formating not content.
 
Unfortunately, Microsoft has not adhered to the HTML specifications:

W3C said:
Visual user agents must ensure that the content of the Q element is rendered with delimiting quotation marks. Authors should not put quotation marks at the beginning and end of the content of a Q element.

So personally, I would bodge it for IE with conditional comments that contain quotes. These take the form:

Code:
<!--[if IE]>
<![endif]-->

You can see the "before" and "after" effects when comparing the following code in both FF and IE:

Code:
<html>
<body>
	And so I said to him <q lang="en-uk"><!--[if IE]>&quot;<![endif]-->I have never been so exhausted after such a marathon session<!--[if IE]>&quot;<![endif]--></q>
	<br />
	And so I said to him <q lang="en-uk">&quot;I have never been so exhausted after such a marathon session&quot;</q>
</body>
</html>

Hope this helps,
Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
I meant include &quot; (or a character code) in the HTML.
I've used character codes in the past and never worried about the <q> tag. Pages validate OK. It's just not "proper" web standards I guess.

The simple fact is that IE doesn't understand the <q> tag properly and won't apply quote marks to it. You could use CSS to make <q> elements italic or whatever. This will display in IE. The drawback then is that browsers that DO understand it will put extra quotes around your HTML quotes!

I guess you could then use CSS to turn the quotes OFF for the <q> tag. At least then you are ready for the day that IE supports <q> properly.

It's a vicious circle!

Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 
One note of caution, however...

The only drawback of that method is, as you can see, the quotes are not language-dependant. They will be fixed to the quotes given in the source, whereas the browser-inserted quotes should be dependant on the language of the quote (or document, if none is specified).

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Then you can specify that the conditional comments only work for anything less than IE 7:

Code:
<!--[if lt IE 7]>

;o)

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Hmm.
I always feel suspicious about IE conditional comments :)

How about this for a more standards compliant solution?

Use a server side script (or even Javascript - might be more suitable) to sniff the browser and replace <q> with a left quote mark and </q> with a right quote mark.

That way the markup will still be standards compliant.


Foamcow Heavy Industries - Web design and ranting
Toccoa Games - Day of Defeat gaming community
Target Marketing Communications - Advertising, Direct Marketing and Public Relations
"I'm making time
 
In fact - thought it made a good FAQ:

faq215-5846

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
How about this for a more standards compliant solution? ... Use a server side script ... to sniff the browser

How is browser sniffing server-side instead of client-side any more standards compliant? Both should validate equally, as far as I can see.

Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]

 
Thanks all of you. I tried


CODE
<!--[if IE]>
<![endif]-->

and I think this is the solution for me right now.
 
works for me. I didn't know about <cite> tag. Thanks. It's simpler.
 
Good point, Clive - that's another good one to use. It really depends on what the content of the element would be to which one would be best suited, however (this remains unknnown to us).

See here for more details on which ag to use for what purpose:


Dan

[tt]D'ya think I got where I am today because I dress like Peter Pan here?[/tt]
[banghead]
 
From BillyRayPreachersSon's link (Thanks Dan!) - the W3C example says
As <CITE>Harry S. Truman</CITE> said,
<Q lang="en-us">The buck stops here.</Q>
Which means in this case that Q is still the tag to use for the quote; cite tells us who the quote is from.

I believe conditional comments are the way to go with the Q tag - they're standards compliant, they correct (mis)behaviour in IE, and don't seem to have any ill effects in other browsers.

<marc>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top