simple html question
- Started
- Last post
- 10 Responses
- studderine
so lets say you have a list that looks like this:
Arizona
Phoenix
Hotel 1
Hotel 2
would you use <dl><dd></dl></dd> to define this list?thanks!
- bulletfactory0
how would you like the list presented?
<dd> are inset from the <dl>
- OhYeah0
I would, don't like <ul><li>.
Use it like this:
<dl>
<dt>item here</dt>
<dt>item here</dt>
<dt>item here</dt>
<dt>
<dd>item here</dd>
<dd>item here</dd>
<dd>item here</dd>
</dt>
</dl>
- studderine0
^
i was thinking dl,dd would suffice, but that would only work for the first two items in the list. what about hotel 1 and 2?
- Lillebo0
I usually use <ul> and <li> and then define different levels of li with classes through CSS...
- doctor0
Ideally presentation issues like this should be done using CSS, and not by adding meaningless mark-up. In my oppinion the semantically correct way to fix your problem, would only involve an unordered list <ul>. Do the indents in your CSS.
However you could also use definition lists, partly to fix your problem, ie.:
<dl>
<dt><strong>Phoenix</strong></dt>
<dd>
<ul>
<li>Hotel 1</li>
<li>Hotel 2</li>
</ul>
</dd>
</dl>Everything you need to know about lists: http://www.w3.org/TR/html401/str…
- studderine0
loads of good answers, thanks!
- doctor0
<style>
ul { list-style-type: none }
.lev-1 { margin-left: 20px }
.lev-2 { margin-left: 40px }
</style><ul>
<li>Arizona</li>
<li class="lev-1">Phoenix</li>
<li class="lev-2">Hotel 1</li>
<li class="lev-2">Hotel 2</li>
</ul>- ah, i'm just trying to get away from using css to do the list.studderine
- thank you for the help.studderine
- You should always - always - use CSS to determine how your content is displayed.doctor
- i understand that, seperate content from presentation, but for my purposes i wanted the purely html waystudderine
- I can't imagine why, but best of luck to you anyway. :)doctor
- studderine0
ahee, i got it. no sleep is no good. thats a fact!