We use our extranet daily to present a lot of work to our clients. From wireframes to Photoshop mockups and business goals to sketched opportunities, we have several established ways of presenting information. One of the ways we handle versioning, or the updating of assets on the extranet, is through a dl-powered navigation list.
When we need simple and effective on-page navigation, to either jump to content on the page or flip to another view, we use the dl element. Its sub elements, the dt and dd, make it very easy for us to create inline links with a clear label. Here we're going to share with you a fast, lightweight method for how we'll use CSS to do it.
The dl element is a definition list. Plain and simple, it's an HTML element that is used to display terms (dt) and their descriptions (dd). However, definition lists aren't just semantically limited to dictionary style definitions. Rather, they are very versatile and can be used in a handful of meaningful ways:
Each instance is still semantically correct (you have a term and description), but serves a variety of different uses. We love to see HTML elements be flexible enough for varied applications and have no problem utilizing them this way in our own work.
As we mentioned before, we use dls for simple, scalable sub navigations. It's an easy and semantically correct way of labeling a set of links for added context. To better illustrate what we mean, here's a screenshot from one of our client's extranet page:
As shown above, the light gray "label" is the dt while the sub links are instances of dds with links inside. The gray label on the left helps tell users what this nav is for: links on this page. This makes our nav easy to understand and more meaningful. Now, let's break down the HTML and CSS used to create this sub navigation.
We'll use four HTML elements to create the necessary markup for our sub navigation. Take a look:
<dl class="nav"><dt>On this Page:</dt><dd class="active"><a href="#">Final Wireframes</a></dd><dd><a href="#">Updated Wireframes</a></dd><dd><a href="#">Initial Wireframes</a></dd><dd><a href="#">Sketches</a></dd></dl>The CSS is equally simple as the HTML. We've coded up styles for the entire list below, including an active or current state for our links. Check it out:
Here's a quick step-by-step look at what we're doing with the CSS for the list:
And that's that. Small HTML footprint and light, flexible CSS that works well across all browsers (save the browser extensions) and doesn't even require any images.
We've put together a shorter walk-through with our demo code. It works in all browsers, but it works especially well in Safari and Firefox (due to the rounded corners). Be sure to check it out and leave your questions or comments below!
Nice work, and very interesting... I've always thought of the definition list (dl) as one of the most under-utilized elements in HTML. But I've never personally used it outside of a scenario where there is not a 1:1 ratio of the definition terms (dt) to definition descriptions (dd) within the list. I'm curious as to why you propose this solution, rather than a heading followed by an unordered list (ul), since the items in your example are essentially a list of items on the page. I'm not saying you're wrong in taking the approach you have – I'm simply looking for more insight as to the thought process that let to the decision.
@Dwayne: Glad you asked! The point here was to create a solution that was low on CSS, self containing, and easily scalable. A heading and an unordered list would have done the trick, yes, but they are different elements—we wanted one element to do the trick.
The choice in elements might seem odd, but it's easier to work with and style than a div wrapping a heading and an unordered list. Plus, it's fun to try something new! :)
I did find your choice of HTML elements odd at first, but hearing you explain it helped me understand the thought process and reasoning behind it. This is definitely a better way to do this type of navigation and I'll definitely keep this in the back of my head.
I'm all about axing unnecessary markup where possible!
When do we get to see what your extranet pages look like? I love seeing how people handle deliverables.
@Kevin: We hear ya! We try to make things easy on ourselves, and combined with an urge to try new things and experiment with CSS, we end up with some crazy ideas. This was a pretty grounded one from several people on the team.
@David: Hah! Maybe soon—since so much of our work is under NDA, it's hard to say for certain if we would show anything to the public. We're also working on a new extranet in the coming months. Perhaps until then we'll share more about how we present information there?
Two great articles in a row, just came across the Polaroid-transformation! You guys rule, more I say, more! + Thank you.
@Dwayne - Like you also was surprised to see the one-to-many relationship in the demo. Wasn't even aware you could get away with that.
Would using a DL over a UL reduce the SEO? Thinking that Google might place more prominence on the traditional UL.
Thank you for sharing. IT good tutorial.
Great Stuff. Never thought about using the DL for this. Good explanation on Dwayne's comment :)
thanks for tutorial. Love it, simple and effective :D
thanks for tut, very usefull.
thanks for tut, very usefull.