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

the <tt> html tag
the <tt> html tag

The <tt> html tag

Overview

In HTML the <tt> tag is a little unsual and is not often used due to its quirky apperance, in short the font mimics that of a teletype machine. The <tt> tag is one of the original ways to format text and more recently CSS and other tags have reduced the importance of this tag. It is still a good tag when used correctly. When text is put between the opening and closing <tt> tag it is displayed as tt text. The <tt> tag can be used multiple times on a webpage and can be nested inside other tags for dramatic effect.

Basic Usage

<tt>Some tt text</tt>
Any text between the opening and closing tag will be displayed as a large heading.

Advance Usage

It is possible to style and add functionality to the <tt> tag, this is done by adding an attribute to after the tt in the opening <tt> tag.
Attributes allowed for the <tt>tag include :-class, dir, id, lang, style and title.
In most cases class and id are used and its basic usage is shown below
<tt id=”header”>Some tt text</tt>
With all attributes there is a space after the initial b 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 <tt> tag the class attribute is nearly always used over the id attribute although in practice it makes no difference.
The attribute style allows you to include css style information for a single <tt> 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

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

Final Thoughts

Touching on just the surface of the <tt> 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.

Keyword use in body text

Overview Google, also know originally as an information engine was set up to locate the information people wanted to find. A HTML webpage has several parts to it, of which the <body> tag contains most of it. It’s in the Body tag section which the web browser shows what is considered as the webpage. It is therefore no surprise that Google looks as this aspect when deciding on how to rank a webpage. History of the <body> tag The <body> tag is one of the core HTML tags which have been within HTML pages since day one. Most of code used to display a page is contained within this section. It is for this reason Google places great weight on the content within this section. To some degree Google has now gone full circle with its approach. In the beginning pretty much only the on page copy was considered for…

The <caption> html tag

Overview The <caption> HTML tag is used to specify a title for a HTML Table. It can only be used once per table and the <caption> tag must appear immediately after the <table> tag. It works equally as well in table based layouts as well as CSS based ones. When text is put between the opening and closing <caption> tag it is displayed as a table caption text. Basic Usage <caption>Some table caption text in here</caption> Any text between the opening and closing tag will be displayed as table caption text. Advance Usage It is possible to style and add functionality to the <caption> tag, this is done by adding an attribute to after the caption in the opening <caption> tag Attributes allowed for the <caption>tag include :-class, dir, id, lang, style and title. In most cases class and id are used and its basic usage is shown below <caption…

Keyword use in page URL

Overview Keyword use in page URL is a technique much in the same vein as Keyword use in domain name. There is currently no evidence that Google is penalising sites which place keywords in the URL of the webpage, but this should be reviewed over time with regards to how important this ranking factor will be going forward. The importance of keywords in the domain name The below is an extract from the article which details the history if keyword in Domain name. Much of the below can apply to keyword use in URL but as with domain name should be reviewed in light of the recent Google EMD update. Originally it took a lot of money, time and effort to create a website. During this period people who had invested in a domain name which matched what they did was seen to have benefits and reinforce the likely content…

How expensive is your free marketing?

With in excess of 100 million websites on the internet, there is always competition to get your website listed on search engines like Google. For big companies and corporation’s conventional advertising has always been a part of promoting their brand or image. For small companies and individuals who have no marketing budget, companies like Google, gave the promise of ‘free advertising’ for a piece of their online soul. But like all things starting in the USA, is there ever a free lunch, or are there hidden costs? Small time, big aspirations With a recession on and with tough times ahead, who wouldn’t want to promote their website for free? SEO and Viral marketing are often suggested as a way to get your message out there cheaply. In the early days this was very true, with a tweak here and there to your page copy, or playing with the html code…

Number of visitors to the site

Overview It may sound a little like the quip about which came first the egg or chicken, but there is some evidence to suggest search engines like Google may look at visitor number when determining how to rank a site. This controversial view has to some extent been confirmed by Google in a statement where they are looking to promote pages to you which your ‘friends’ find interesting. Although we can’t influence this directly we can look at other supporting techniques that can achieve the same thing. The importance of Number of visitors to the site Right from the days of the first web pages and the first incarnation of the Google search engine, Google has been looking at ways it can provide the user with exactly the information they want to access. Knowing how powerful the first few results on Google are has caused a complete industry to be…

© 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