Ted Drake wrote:
I want to put some code into a page for people to cut and paste.
for example, I'd like the page to say

Simply add this code to your site:
<a href="http://www.csatravelprotection.com"; title="Purchase travel insurance from CSA Travel 
Protection" >Travel Insurance</a> - CSA Travel Protection

Or something like that.

Now, my question is, what is the best way to represent code. Should I convert all my < signs to the &lt; code? Should I wrap it in a <code> tag? I've seen people use text fields, but that doesn't seem very semantic. What is the best? What does the code tag do?

The <code> element does nothing in and of itself. It carries structural meaning, in that its content is marked up as being, well, code. Browsers will also choose some visual rendering (usually monospaced typeface). Beyond that, it "does" nothing. You'll still need to encode < > as &lt; and &gt;, yes. Once somebody copies this, it's automatically converted to < > again by the browser before going to the clipboard (i.e. pasting it will not result in &lt; or &gt;, but the proper < >)
--
Patrick H. Lauke
_____________________________________________________
re�dux (adj.): brought back; returned. used postpositively
[latin : re-, re- + dux, leader; see duke.]
www.splintered.co.uk | www.photographia.co.uk
http://redux.deviantart.com


******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to