So, now you know what HTML & CSS are (that’s always good XD), and how to format your basic text. That’s your normal text, your bold text, and your italic text. You shall now be learning about some fancier text, like strikethrough, underlined, and
. Note: overlined text isn’t really a picture, it is jsut the only way I could work out to put it on WordPress.
Strike Through Text
Basically, this is the computer equivalent of having your text crossed out, like this. You could use it, for instance if you want to show that you have got rid of some old information, but you still want people to see it. Or, perhaps if you were correcting something on a webpage, you could use the effect. The standard tag for strike through is <strike></strike>. This is how you would format it:
strike
{
text-align: left;
text-indent: 5px;
text-decoration: strikethrough;
color: #000000;
font: 10px Arial, Verdana, Helvetica, Geneva, sans-serif;
} |
- Very similar to your Basic Text, don’t you think? If you don’t remember, go and have a look, then come back. The only differences are in bold and coloured.
- The name is one change. It is pretty simple, so I don’t think that there are many ways that you can really go wrong. The name is strike for the tag, written <strike></strike>.
- The more important change is text-decoration. This is how we do the three fancy bits of text. Text-decoration can do a lot of things, in this case, lines. Write “strikethrough;” after text-decoration.
Underlined Text
Well, this can be used to define something, as well as your strong/bold text. It also comes in handy for other things, which I shall mention later on in the blog. The tag I use for the effect is <u></u>. I believe there are other ways of doing it, via HTML though, not CSS.
u
{
text-align: left;
text-indent: 5px;
text-decoration: underline;
color: #000000;
font: bold 10px Arial, Verdana, Helvetica, Geneva, sans-serif;
} |
- The first difference is the name. There isn’t really much to say about the name apart from that.
- Next, comes the return of text-decoration. Although, this time you don’t say strikethrough, but underline instead. It this feature especially is used in more than just underlined text.
- The final change is optional. If you wish to stress your underlined text more, then do what you have done with bold text before, and write bold, before the rest of your font information.
Overlined Text
Even I have to admit, I doubt that there are many uses for this type of text. Still, there are a couple of uses, and why not just learn it now, anyway? Overline is basically the opposite of underline, and is looks like this:
. The thing is, overline is so uncommon, that I don’t think there is a standard tag for it. I guess we shall just use <overline></overline> or a shorter version, <over></over>.
overline or over
{
text-align: left;
text-indent: 5px;
text-decoration: overline;
color: #000000;
font: 10px Arial, Verdana, Helvetica, Geneva, sans-serif;
} |
- Once again, the changes are pretty much the same as when we did underline. Seeing as this is the opposite of underline, it makes sense, kinda.
- Firstly, we have changed the name of the tag to overline, or over, or anything you feel is appropriate (just keep it clean)!
- And finally, it is the last appearance of text-decoration for the moment. In this case, we have replaced underline, or strikethrough with overline – Easy.
And that is it for today. You have now learnt two more valuable skills of CSS, as well as one that is a little bit different. These are: strikethrough, with the <strike></strike> tags, underline, with the <u></u> tags, and finally,
, with the <overline></overline>, <over></over>, or anyhting clean you can think of tags/ Happy CSS’in!