|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to put quote within quotes in an HTML tag attribute?
How can I do something like:
<a href="this is a "test" for quotes"> In most prog-languages you'd escape by a preceding backslash. BUT! I need to be able to use quotes outside and inside, I can not use singles inside doubles or vice versa. Any thoughts are appreciated. |
|
#2
|
||||
|
||||
|
I'm curious, why can't you use single-quotes?
The other solution is to use character entities: Code:
<span title="this is a "test" for quotes">
__________________
Spreading knowledge, one newbie at a time. Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions IE7: the generation 7 browser new in a world of generation 8 browsers. Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around. Last edited by Kravvitz : Yesterday at 01:15 PM. |
|
#3
|
|||
|
|||
|
I don't think Kravvitz's code came out quite right (the character entities were recognized as quotes
).Use & quot ; (remove the spaces between the &, quot, and ; ) in lieu of " such that it won't be recognized as the end quote of the href. It will still display as a quote in links or in text, though. Wikipedia has an article here . It's the same method you can view < and > in a browser without them being recognized as HTML tags.... igfud |
|
#4
|
|||
|
|||
|
Thank you both.
I noticed that <a href="file with %22quotes% inside.html"> also works for file: file\ with\ \"quotes\"\ inside.html (a.k.a.: file with "quotes" inside.html) |
|
#5
|
||||
|
||||
|
You're welcome
![]() "%22" is a URL encoded character. As far as I know, it will only work where a URL is expected. (By the way, spaces in URLs must be URL encoded.) Quote:
Thanks. I fixed it now.Last edited by Kravvitz : Yesterday at 01:19 PM. |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > How to put quote within quotes in an HTML tag attribute? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|