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!

How can I make a Hn begin with an o

Status
Not open for further replies.

deltarho

Technical User
Apr 22, 2003
36
0
0
GB
How can I make a Hn begin with an open quote and end with a close quote?
 
deltarho,

In CSS2, this should work:

Code:
<STYLE TYPE=&quot;text/css&quot;>
  h1:before {
    content: open-quote;
  } 
  h1:after {
    content: close-quote;
  } 
</STYLE>

This link shows that it works in NetScape 6+:

Another link:

However, in my IE5, it does not work?!

Another approach could be a JavaScript function like this one (placed in the HEAD section of your code):

Code:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
  function myH1(text) {
    document.write('<H1>&quot;'+text+'&quot;</H1>');
  }
</SCRIPT>

... and this goes into the BODY where needed:

Code:
<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
  myH1('This one has quotes!');
</SCRIPT>

Good luck §;O)


Jakob
 
deltarho
Another way is to use HTML escape sequences.

i.e. &#147; gives an open quote,
&#148; gives a close quote,
&ampquot; gives a neutral quote that could be used as either an open or close quote

E.g.
Code:
<H1>&#147;Heading Goes Here&#148;</H1>

will show on your page as

&quot;Heading Goes Here&quot;

dolphyn
 
Thanks Jakob and dolphyn

What I was doing was pasting quotes from several sources including email and reconfigured H6 in OE6 so that they all rendered with the same font-family and so on. Just dropping the cursor into the text followed by Format>Style>Heading 6 worked a treat. Being bone idle I wanted open and end quotes inserting for me.

I couldn't quite figure the before/after in a CSS context and your first suggestion, Jakob, looked like a winner. It appears that it doesn't work with IE6 on board either.

Had you known what I was up to both of you probably wouldn't have mentioned the other methods as they, in this context, would be a hassle compared with my just inserting the quotes into the text myself.

I will look further into the before/after method because I find it hard to believe that IE6 is failing here. Perhaps MS are using an unconventional syntax. No surprises on that score!

Thanks again guys.
 
deltarho,

So you've got many files to edit...

I use a text editor called NoteTab Light to write my code in. NoteTab can work with multiple documents and you can easily search/replace all instances in all documents. Quick and easy! And free!

Heres the link:
Good Luck §;O)


Jakob

PS. Let us know if you find a better workaround!
 
Thanks Jakob. I use Textpad which has many syntax files including html. I've been using it for years but it is shareware.

It looks like ':before' and ':after' has not been implemented in the IE html parser. It doesn't even appear to have been implemented in Firebird either. Pity, as I cam imagine many uses besides my simple use.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top