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

the <var> html tag
the <var> html tag

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 p in the opening <var> tag
Attributes allowed for the <var>tag include :-class, dir, id, lang, style and title.
In most cases class and id are used and its basic usage is shown below
<var id=”header”>Some variable text</var>
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 <var> tag may use either the id or class as an atribute.
The attribute style allows you to include css style information for a single <var> 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

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

Final Thoughts

Touching on just the surface of the <var> 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 <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,…

Keyword use in domain name

Overview Exact Domain Matching has hit the headlines recently as Google has tried to crack down on this latest trick spammers use to bend the Google search results. Although Exact Domain Matching may now not work as it once did, domains which feature a close match still work and it could be argued that a close match can now take the place where Exact matches once stood. The importance of keywords in the domain name 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 a website would have. In short the domain name could give Google a good ranking signal. Over the last decade the cost of publishing to the web has dropped drastically and for little or no…

Adobes Flash in the pan

Adobe Flash, once the popular option for creating animations, websites and games on the net, has recently come under attack by Apple, Google and Microsoft. Is it time to start turning our backs on Adobe, or will the competition finally come unstuck? A short History Created in 1996 by a company called Macromedia, Flash was originally conceived to allow designers and programmers to bring animated graphics and interactive features to the web. As the web browser of the time (and also for many of the browsers today) did not support Flash directly, Macromedia created ‘Flash Player’, a virtual machine which allowed Flash Animations to be shown on all but a few non supported systems. Flash was not the only tool that gave this functionality and Java created a year earlier also brought interactive elements to the web, but due to coming from programming routes, meant Flash was used over Java…

The <center> html tag

Overview By default body text in a HTML document is aligned left, by using the <center> HTML tag you can make the text appeared centered within its surrounding tag. It is a widely used tags in HTML today. It works equally as well in table based layouts as well as CSS based ones. It was often used in the past to centre the content of <div> tags, but this is now usually dealt with purely in CSS. As with all older 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 <center> tag it is displayed as a center text. Basic Usage <center>Some center text in here</center> Any text between the opening and closing tag will be displayed as a center text. Advance Usage It is possible to style and add functionality…

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…

© 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