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

the <cite> html tag
the <cite> html tag

The <cite> html tag

Overview

The <cite> HTML tag is known as a phrase tag, it is mainly used to style text. By default it displays text as italic which is ideal for showing a quotation or citation. 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 <cite> tag it is displayed as a citation text.

Basic Usage

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

Advance Usage

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

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

Final Thoughts

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

Website for £99

Offers

 

Categories

 

Our blog

Some random stories from our blog.

Yell Sites, are they hell sites or are Yell Sites well SEO’d websites

With everyone’s favourite local directory website now offering SEO and marketing for your website, does Yell really have a real world solution or is it style over substance? In this article I will show you what is needed to SEO any webpage, so you can decide. Now let’s be clear about the definition of SEO before we begin. SEO is not marketing and SEO is not copywriting. The only purpose of applying SEO is to increase where your listing appears in Google. Copywriting and Marketing are there to help convert visitors to customers. While it is true that copy can be written that will convert visitors to customers, and will rank well on Google, it is important to decide which is more important for any given page. Is the primary focus to increase visibility on a Search engine on Google or to make use of the natural traffic you already…

Accessible web design – an oxymoron

The <tt> html tag

The <div> html tag

Pop goes the Google

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