Jump to content

Suit symbols in html/xml/css


Recommended Posts

I am creating a bridge blog and in the process I wondered about the use of suit symbols:

 

Using CSS 2.1, I can define classes for red suits and black suits respectively. However, the code doesn't look particularly "clean" to me, with classes and spans all over the place, e.g. in auctions. However, that's only a minor concern - and only to the geeky part of me. The worst is that it's a pain having to type "<span class="blacksuit">♣</span>" every time I want to describe someone bidding or playing clubs ;) .

 

I would like it so that I can write 2!H in the input field, and the output becomes 2, just like in these forums. How is this normally done on bridge blogs and sites? Using JavaScript? PHP? MySQL? XML?

 

I think I am missing something obvious - enlighten me :(

Link to comment
Share on other sites

If you look at the source for this page, it shows the suit symbols in the way you suggest. The conversion from !s to <span class="spades">♠</span> takes place on the server. Your blog host probably doesn't support this.

 

Blogs sometimes use gif images. If you are a LaTeX user the easiest solution may be to use Latex2html.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...