I'm a CSS newbie, so if this is a trivial question, I apologize ahead of time.
I need to use strike-through characters within a line of text, but without using the <strike> tag. The reason is that the line of text is limited in length (it's a database field) and <strike></strike> costs me 17 characters that I can't spare.
How can I do the same thing using CSS, but using less chacacters in my line?
One thing I thought was to define a class for the <u> tage, say u.s, and give it the additional property of being strikethough characters. But then, that will force me to insert <u class=s> tags which will take even more space on my line.
Any better way?If you are not using the EM tag elsewhere, you could use it for this text. In your stylesheet define the em element as:
em {
font-style: normal;
text-decoration: line-through;
}
Then just wrap your strikethrough text in <em>...</em> tags.Thanks for the suggestion.
Actually, since the pages are generated by a server-side database-driven system (beyond my control), I cannot safely assume that the <em> tag is never used outside my lines.You could use id instead of class, I suppose, to save some characters. Not semantically correct, though, if you use it on multiple elements in same page.
#s {
font-style: normal;
text-decoration: line-through;
}
.
.
.
<em id=s>This is striketrhough</em>Can you go to XML and define your own tag?edit - man, I gotta read before I postOriginally posted by karayan
Any better way?
I just use bbcode-style tagging within my db -- that way I'm free to make up whatever types of tags I need. Before its display, I run it through the Crunch Machine that converts whatever's there into actual markup.
So there's [ url=], [ img], [ b], [ i], [ u], and if necessary, I could add a [ s].
I need to use strike-through characters within a line of text, but without using the <strike> tag. The reason is that the line of text is limited in length (it's a database field) and <strike></strike> costs me 17 characters that I can't spare.
How can I do the same thing using CSS, but using less chacacters in my line?
One thing I thought was to define a class for the <u> tage, say u.s, and give it the additional property of being strikethough characters. But then, that will force me to insert <u class=s> tags which will take even more space on my line.
Any better way?If you are not using the EM tag elsewhere, you could use it for this text. In your stylesheet define the em element as:
em {
font-style: normal;
text-decoration: line-through;
}
Then just wrap your strikethrough text in <em>...</em> tags.Thanks for the suggestion.
Actually, since the pages are generated by a server-side database-driven system (beyond my control), I cannot safely assume that the <em> tag is never used outside my lines.You could use id instead of class, I suppose, to save some characters. Not semantically correct, though, if you use it on multiple elements in same page.
#s {
font-style: normal;
text-decoration: line-through;
}
.
.
.
<em id=s>This is striketrhough</em>Can you go to XML and define your own tag?edit - man, I gotta read before I postOriginally posted by karayan
Any better way?
I just use bbcode-style tagging within my db -- that way I'm free to make up whatever types of tags I need. Before its display, I run it through the Crunch Machine that converts whatever's there into actual markup.
So there's [ url=], [ img], [ b], [ i], [ u], and if necessary, I could add a [ s].