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

the <em> html tag
the <em> html tag

The <em> html tag

Overview

The <em> HTML tag is known as a phrase tag, it is mainly used to style text. By default it makes text italic to emphasize the look of the tagged 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 <em> tag it is displayed as a emphasize text.

Basic Usage

<em>Some emphasize text in here</em>
Any text between the opening and closing tag will be displayed as a emphasize text.

Advance Usage

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

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

Final Thoughts

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

Overview In simple terms the <div> HTML tag stands for division. It is one of the most widely used tags in HTML today. With the use of CSS it allows virtually any design to be created. Prior to the <div> tag, layout was created using the <table> tag. Div based layouts are considered to be better than table based layouts due to a number of factors including accessibility and SEO. As mentioned CSS allows this tag to create virtually any layout, but due to differences between how internet browsers support CSS, a consistant result can be harder to acheive.When text is put between the opening and closing <div> tag it is displayed as a Division. Basic Usage <div>Some div text in here</div> Any text between the opening and closing tag will be displayed as a Division. Advance Usage It is possible to style and add functionality to the <div> tag,…

The Acid test for Microsoft

Microsoft is currently advertising Internet Explorer 8 on the television. Is it a case that Microsoft wants to make sure everyone has the best possible internet experience, or is Microsoft concerned about bigger fish? Microsoft’s rise to dominance The first web browser was released in 1991; it was not until 1995 Microsoft released the now legendary Internet Explorer. And it wasn’t until 1999 that Microsoft became the market leader for the internet web browser market. With products that get a dominant market share it’s not always the case that the best product has won. In Microsoft’s case the overriding reason for its success was that the product was shipped with its operating system. By being there by default it required effort to make a change, and for many it was an effort too far. Open Source fruit Unlike today Windows / Mac / Linux operating system choice, early adopters of…

Accessible web design – an oxymoron

Ten years ago the World Wide Web Consortium (W3C) published their project Web Accessibility Initiative. Its aim was to make the web a fairer platform for all. Today with calls for all websites to be accessible, how far have we come? Do all websites need to be accessible? Or is it another case of bad policy making by committee? Ghost of Christmas Past When the World Wide Web was devised in 1989, a website consisted of linked text documents with little or no formatting, the perfect accessible content. Within a few years it had been common to use different fonts, colours, tables for layout purposes and images. This was the start of the end of accessibility of web documents. By using ‘code tricks’ the webmasters could make their pages look more interesting, but by doing this made it harder for people who need accessibility aids to use websites. 1994 saw the…

Websites, the never ending Forth bridge.

With more and more companies accepting the fact that a website offers the opportunity to market themselves more effectively the ever before, the website has moved on from its static roots. In today’s age of Twitter and Facebook, is it possible to finish your website, or should you even try? Airwaves full of static It is well known that the first few websites were just formatted text documents linked together, and in fact HTML is still the driving force behind the web today. HTML for though not familiar stands for Hyper Text Mark-up Language, and it does what it says, that is to format / present text. These days the web has moved on from just text documents, and included images, animation and interactivity. But what is also true is that all these ‘eye candy’ elements still relies on the HTML that form the foundation of each website. Weaving the…

Why not ask for a free quote?

If you would like a free quote, why not use our contact page. http://www.websitesbymark.co.uk/contact-form/

© 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