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

the <ul> html tag
the <ul> html tag

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.

Advance Usage

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

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

Final Thoughts

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

Overview The <code> 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 displaying samples of programming code. 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 <code> tag it is displayed as a code text. Basic Usage <code>Some code text in here</code> Any text between the opening and closing tag will be displayed as a code text. Advance Usage It is possible to style and add functionality to the <code> tag, this is done by adding an attribute to after the p in the opening <code> tag Attributes allowed for the…

Keyword use in IMG ALT attributes

Overview The original HTML standard has always been geared with the idea of linking text documents together, but even from the earliest days there has been support for displaying images. In the starting days of the internet effective download speed were very slow and even pages containing text may take many seconds to display. When people started using images download times increased drastically and often the browsers allowed you to ‘turn off images’. For web pages that realised on graphics to be usable, this presented a real issue. Fortunately images had always had the ability to contain a text description about what the image was about. Now known as the IMG ALT tag it’s not only used for the above instances, but also is now a great component in making web pages accessible to users with a visual impairment. In addition because search engines like Google cannot see images, they…

The <h2> html tag

Overview In HTML h tags stand for heading and this is split into 6 different h tags (h1, h2, h3, h4, h5 and h6). The <h2> tag itself is considered to be the main repeating heading for a webpage. By default it is displayed much larger than the body text but smaller than the main <h1> header. As with all h tags it is considered important for SEO.When text is put between the opening and closing <h2> tag it is displayed as a large heading. Unlike <h1> a <h2> tag can be used multiple times on a webpage as its job is to be the heading for a web pages main sub topics. Basic Usage <h2>Large header text</h2> 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 <h2> tag, this is done…

MasterCard’s master plan to take over the world.

In recent years supermarkets like Tesco’s have been offering more than just food. They now offer everything from electrical, personal finance and even in one case the ability to buy your next home. With MasterCard’s recent decision to enter the arena of online retailer, is this a good thing for consumer or in a tricky credit market, is it a way for companies like MasterCard to reduce risk and make bumper profits? The vanishing high street 1995 saw the online birth of Seattle Company Amazon, initially set up as a ‘one stop bookshop’ where any book currently published could be bought. Within a short period of time Amazon started expanding it range of merchandise it sold, becoming the world’s largest online retailer. The benefits Amazon had for the consumer, choice and value. If the item was available, Amazon would have it and cheaper than anyone else. It wasn’t long before…

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…

© 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