the <s> html tagWebsites by Mark - 7 Woodrush gardens, Carterton, Oxfordshire. OX18 1JE

the <s> html tag
the <s> html tag

The <s> html tag

Overview

The <s> HTML tag is mainly used to style text it has the same functionality as the <strike> HTML tag. By default it displays text as with a strikethrough line through it which is ideal for showing corrections or previous amended text. It works equally as well in table based layouts as well as CSS based ones. As with all phrase based HTML tags it can be used in situations where consistancy between browsers is difficalt to acheive in other ways. When text is put between the opening and closing <s> tag it is displayed as a strikethrough text.

Basic Usage

<s>Some strikethrough text in here</s>
Any text between the opening and closing tag will be displayed as strikethrough text.

Advance Usage

It is possible to style and add functionality to the <s> tag, this is done by adding an attribute to after the strike in the opening <s> tag
Attributes allowed for the <s>tag include :-class, dir, id, lang, style and title.
In most cases class and id are used and its basic usage is shown below
<s id=”header”>Some strikethrough text</s>
With all attributes there is a space after the initial strike then the attribute name, then an equal’s sign and the identifier of the attribute in double quotes.
Both id and class attributes refer to CSS styling of the element and is either stored in the <head> of the webpage on in an external file.
With id this usually refers to a single instance on a page where as class usually refers to a repeating element on a page, it is for this reason for the <s> tag may use either the id or class as an atribute.
The attribute style allows you to include css style information for a single <s> tag.
The dir attribute allows for left reading and right reading text, lang allows you to specify a language for the tag and title allows you to include extra information for a tag.
It is possible to attach scripts to tags, as well adding functionality to a webpage, these scripts tend to be written in Javascript and therefore outside the scope of this document

Examples

<s>Some strikethrough text</s> – basic usage example.
<s id=”header>Some strikethrough text</s> – strikethrough text which is styled by the id header.
<s class=”headerclass”> Some strikethrough text </s> – strikethrough text which is styled by the class headerclass.
<s id =”header” class=”headerclass”> Some strikethrough text </s> – strikethrough text which is styled by the class headerclass and the id header.
<s style="color:#F00">Some strikethrough text</s> – strikethrough text which has a custom colour of red.
<s dir="rtl">Some strikethrough text</s> – strikethrough text where the text reads from right to left.
<s lang="uk">Some strikethrough text</s> – strikethrough text where the language has been tagged as UK.
<s title="ptitle">Some strikethrough text</s> – strikethrough text where the tag has been titled ptitle.

Final Thoughts

Touching on just the surface of the <s> HTML tag it is easy to see how versatile it is. To take full advantage of it an understanding of CSS is an advantage.

Our blog

Some random stories from our blog.

The <h4> html tag

Overview In HTML h tags stand for heading and this is split into 6 different h tags (h1, h2, h3, h4, h5 and h6). The <h4> tag itself is considered to be a small repeating sub header for a webpage. By default it is displayed as bold version of the body text and smaller than the <h3> header. As with all h tags it is considered important for SEO.When text is put between the opening and closing <h4> tag it is displayed as a Small heading. Unlike <h1> a <h4> tag can be used multiple times on a webpage as its job is to be the heading for a web pages sub topics. Basic Usage <h4>Small header text</h4> Any text between the opening and closing tag will be displayed as a small heading. Advance Usage It is possible to style and add functionality to the <h4> tag, this is done…

Anchor texts of backlinks

Overview Anchor text is a technical term to describe any text which is a link… There is also a version of this that applies to images links. Due to recent Google updates this technique is not as important as it once was, but it should still be looked at History of Anchor text Tim Berners-Lee, a former telecoms engineer is widely regarded as the person who invented the internet as we see it today. Amongst the technologies he created, the ability to navigate between documents was to become known as a hyperlink, and without it, it could be argued that the net would simply not function. Beyond being simply a technology to link documents, by ‘naming’ the link, it allowed people to get an idea of what a web page contained before going to it. When the Google search engine was released, one of the signals Google looked at was…

Apple iPad, Killer content or content Killer?

When Apple announced the iPad on the 27th January 2010, many things were expected. Like all rumour based predictions, some came true and some not. But a low powered tablet based computer without a keyboard, webcam or even Flash, is this really the future or has Steve made another Newtonian error? We call it the iPad Positioning the iPad as a device somewhere between an iPod and Laptop, Steve Jobs is once again trying to define a new genre of interaction between user and technology. As with a lot of Apple release kit, Steve has embraced the idea that Eye Candy engages users and well designed gadgets actually overturn conventional thinking and build brand confidence. What is odd about this latest offering from Apple is technology that was expected but is missing. After all this should be a killer way of interacting on social networks like Facebook, but with no…

The <var> html tag

Overview The <var> HTML tag is known as a phrase tag, it is mainly used to style text. It is also mainly used when displaying computer programming code to highlight variables used in the code, although there are actually no restrictions where you can use this HTML tag. It works equally as well in table based layouts as well as CSS based ones. As with all phrase based HTML tags it can be used in situations where consistancy between browsers is difficalt to acheive in other ways. When text is put between the opening and closing <var> tag it is displayed as a variable text. Basic Usage <var>Some variable text in here</var> Any text between the opening and closing tag will be displayed as a variable text. Advance Usage It is possible to style and add functionality to the <var> tag, this is done by adding an attribute to after…

The <strike> html tag

Overview The <strike> HTML tag is mainly used to style text. By default it displays text as with a strikethrough line through it which is ideal for showing corrections or previous amended text. It works equally as well in table based layouts as well as CSS based ones. As with all phrase based HTML tags it can be used in situations where consistancy between browsers is difficalt to acheive in other ways. When text is put between the opening and closing <strike> tag it is displayed as a strikethrough text. Basic Usage <strike>Some strikethrough text in here</strike> Any text between the opening and closing tag will be displayed as strikethrough text. Advance Usage It is possible to style and add functionality to the <strike> tag, this is done by adding an attribute to after the strike in the opening <strike> tag Attributes allowed for the <strike>tag include :-class, dir, id,…

© 2011 Websites by Mark. Do not reproduce any part of this website without permission.
Email : mark@websitesbymark.co.uk - Phone : 07716 447228 / 01993 820005
Postal Address : 7 Woodrush Gardens, Carterton, Oxfordshire. OX18 1JE