Horizontal navigation is quite popular however it becomes restrictive once you’ve got too many pages to list. Once you reach this point then you either need to convert to using a vertical navigation, or start using drop down menus.
Drop downs used to rely on JavaScript however all modern browsers can now manage drop down menus with just CSS (IE7+, Firefox, Opera, Safari; note, JavaScript is still required for IE6 and below).
The HTML …
This is the final part in this 3 part series (see Part I and Part II), and we’re on to Pseudo-element selectors.
:first-line
The :first-line pseudo-element allows you to target the first line of a given target, which must be either a block level element, inline-block, table cell or caption. So, for example, if you wanted to make the first line of a paragraph red then you could use
[sourcecode language="css"]p:first-line { color: …
See last weeks post for part one of Explaining CSS Selectors.
Attribute Selectors
Attribute selectors allow you to target a group of items on a page by matching a particular attribute. This opens up a whole new method of selecting your targets. Unfortunately attribute selectors are not supported in IE6 (which is why they’re not very commonly used), and IE7’s support is a bit buggy at times, however with IE8 out today, hopefully …
Now that we’ve covered a lot of information on HTML and some brief information on CSS, it’s now time to explore the power of CSS even more.
Selectors
Selectors allow you to target specific tags, ids, classes, attributes and more, on a page, ie. target a specific item or a group of items. We’ve seen and used these already briefly, to target type selectors (h1, div, p, a, etc), ID selectors (#idname) …
To be able to control your layouts you need to understand the float property. I’ve briefly mentioned this before and given examples of how to use it but not actually explained it in full. Note, for the following examples I’ve used inline styles, purely to give you an example and show you the code used, however, as always, external stylesheets should be used to reduce code, to create reusable code and to …
Last week I wrote about the specific CSS list properties. This week I’m going to cover some of the positioning properties that are useful with lists but can be used with other html elements as well.
Margins and Padding
Every element can have both a margin and padding given to it, i.e.
Here the element ends at the border, then the margin is the spacing outside …
Last week I covered the HTML Basics for using Lists. This week and next, we will cover the CSS properties for use with lists.
List Specific Properties
We have 3 properties that are specifically for unordered and ordered lists.
list-style-type
The list-style-type property allows you to control the appearance of the list ‘marker’ ie. the bullet point style for unordered lists or the numbering system for an ordered list. For both types of lists you …