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

the <kbd> html tag
the <kbd> html tag

The <kbd> html tag

Overview

The <kbd> HTML tag is known as a phrase tag, it is mainly used to style text. By default it displays text in a fixed width font which is ideal for showing what is expected to be entered by a user. 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 <kbd> tag it is displayed as a keyboard text.

Basic Usage

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

Advance Usage

It is possible to style and add functionality to the <kbd> tag, this is done by adding an attribute to after the p in the opening <kbd> tag
Attributes allowed for the <kbd>tag include :-class, dir, id, lang, style and title.
In most cases class and id are used and its basic usage is shown below
<kbd id=”header”>Some keyboard text</kbd>
With all attributes there is a space after the initial p 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 <kbd> tag may use either the id or class as an atribute.
The attribute style allows you to include css style information for a single <kbd> 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

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

Final Thoughts

Touching on just the surface of the <kbd> 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 <h6> html tag

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

The <ul> html tag

Overview The <ul> HTML tag is used to specify an unordered list. It works in the same way as the <ol> tag but by default shows each list item with a bullet point instead of a number. This can be styled with CSS. The <ul> tag is used to indicate the whole list. Within this tag each list item is listed using the <li> HTML tag. This can also be used in conjuction with the <a> HTML tag and is the accepted way to define navigation links over table based HTML layout options. It works equally as well in table based layouts as well as CSS based ones. When text is put between the opening and closing <ul> tag it is displayed as a table caption text. Basic Usage <ul>Some unordered list text in here</ul> Any text between the opening and closing tag will be displayed as unordered list text.…

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,…

The Impact of the recent EMD update on search engine optimisation

EMD, or Exact Matched Domain, has always been an extremely important process for businesses as they first venture online. With the recent EMD update how should we be thinking as an industry about the way we manage accounts in the future? Put simply, an EMD is an exact keyword used within a domain for instance, if you were purchasing a website domain for an accountant in Bristol, you could use the domain bristolaccountants.co.uk. A brand domain on the other hand would use the name of the company instead. In the past, companies that were purchasing domain names for new websites would choose exact domains in relation to the keyword that they were specifically targeting, giving them an almost certain chance of appearing within the higher echelons of the Google search rankings. With the latest EMD updates things are changing and search engine optimisation professionals may have to tweak their approach.…

Age of web site

Overview The age of the website has been a ranking fact for many years and with the recent change of direction of Google, this would appear to becoming a more important factor again. The importance of the age of websites Google has always looked at ways to quantify the quality of information on every website it visits. The phrase ‘content is king’ is well known and it is for this reason Google places great deal of time and resources working out which sites information are the most accurate for the search terms people use to search on. Over the last decade the cost of domains and the hosting has become cheaper, and for those with no money there are options which allow for free webpages. A more recent trend off the back of this direction has been the blog for money generation. In short you can get paid for placing…

© 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