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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Quotation Marks in HTML 3

Status
Not open for further replies.

RexxSysProg

Programmer
Jul 2, 2004
205
US
Is it still best to use " in place of double quotation marks (") and &33 for single quotation marks (') in text in HTML pages?

If so, here is my problem:

I have documents written in Wordperfect. I copy the text into a new Word/Web Page. That gives me the basic HTML that I need for the document. I tweak it here and there and then the web page is good.

Except for the quotation marks. Word does not change the quotation marks to the above codes. As HTML code uses quotation marks, I would have to select all of the text in the Body and do a Replace. But Word's HTML editor won't let me make the changes. And there is also the potential problem that there is likely interspersed HTML code with legitimate quotation marks, anyway.

So if these codes are still needed, does anyone have a suggestion how I can get them in easily (I have lots of quotations in my pages)without having to buy a regular HTML editor?

Thanks
 
I search and replace the following (Word should support these replaces - I use Textpad or Eclipse):
- right smart quote - ’ (right single quote)
- left smart quote - ‘ (left single quote)
- right smart double quote - ” (right double quote)
- left smart double quote - “ (left double quote)
- normal double quote - "

I leave all single quotes the same.

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
I use ' for single quotes since ! is an exclamation mark.

Lee
 
HTML will work perfectly well, and it is perfectly valid, to use plain " and ' characters in your text. The things you have to be careful about are:

If you're using quotes within an attribute value, you'll sometimes need to use these attributes to put one quote inside another:
Code:
<a href="[URL unfurl="true"]http://www.oreilly.com"[/URL] title="O'Reilly, publishers of the "animal" books">This is bad</a>

<a href="[URL unfurl="true"]http://www.oreilly.com"[/URL] title="O'Reilly, publishers of the &quot;animal&quot; books">This is good</a>
<a href="[URL unfurl="true"]http://www.oreilly.com"[/URL] title='O&#39;Reilly, publishers of the "animal" books'>This is OK too</a>

The other place you need to be careful with is if Word{perfect} puts "smart quotes" into your document. Due to character set issues, browsers often have trouble displaying these - so you can get a ? instead of your pretty left or right quote mark. If you want to use these (which will make your document better looking), you'll have to use the entities that Jeff listed.

Finally, you should technically not be using any kind of quote marks to enclose inline quotations, but using the <q> element instead. Unfortunately, poor browser support makes this element pretty much unusable - I do not personally recommend it - if you want to persevere with this element, check out and the discussion that goes with it.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Thanks BabyJeffy, trollacious and ChrisHunt for your help. So from what you've written I would be OK and not have to change anything to the codes - except that it seems I have the smart quotes interspersed within the many Wordperfect documents I'm putting on the site (it seems that sometimes I had the option turned on while other times it defaulted to being off) and I don't know of any way within Wordperfect to change them to regular quotes (can't enter diffferent types of quotation marks in the Find/Replace function of Wordperfect).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top