views:

88

answers:

4

I have a menu coded in html here, but i need a dotted line to span between the Names and Prices, How would i go about doing that here? I'm kinda lost haha.

You can see it here.

http://mystycs.com/menu/menuiframe.htm

I know i can use css to do it, but how would i get to it span between those two.

Thanks =)

+1  A: 
<style type="text/css">
 .menugroup{
    width:100%;
 }    


 .itemlist{
        list-style-type: none;
 }

 .seperator{
        margin: 5px; 
        width:50%; 
        border-bottom: 1px dotted #000
 }

</style>


<div class="menugroup">

   <ul class="itemlist">
      <li>item name<span class="seperator"></span>price</li>
   </ul>

</div>
gmcalab
Might be better to use a definition list. That extraneous `span` puts me off... if you really need to, why not just wrap both in spans instead? At least it'll be more semantic that way...
Yi Jiang
A: 

Have you considered something like this?

http://5thirtyone.com/archives/776

TripWired
+1  A: 

Wow, where to start? What you have is a number of lists with headers above each, some with notes above and/or below, so that's the markup you should be using:

<h2>Egg Platters</h2>
<div class="note">Served With Home Fries &amp; Toast</div>
<ul>
    <li><span class="item">Two Eggs Any Style</span><span class="separator"> </span><span class="price">2.75</span></li>
  (etc.)
</ul>
<div class="note">Add On Any Two Slices ...</div>
<div class="note large">Add Coffee for $0.50 with ...</div>

Your class="price" is fine, but class="red" and <strong class="bold"> are poor choices -- name the class based on why it's red (like my "note"). Using headings eliminates the need for "bold" to make the <strong> text bigger.

Now, I put in the <span class="separator"> so you could give widths, or use floats, and allow the separator blank space to expand to fill between the item and the price, and you could style it with something like

.separator {
    border-bottom: 1px dotted #333;
}

EDIT: I agree with ClarkeyBoy's comment too; limiting the overall width would help readability, and TripWired's link shows some good method (and uses essentially what I was suggesting)

Stephen P
Maybe I could improve my answer if someone told me why they downvoted.
Stephen P
For the record, I was one of the ones who upvoted! Partly because you supported my comment, partly because I think your solution would work (I say *think* because I havent slept in 24+ hours and I havent tested it!).
ClarkeyBoy
A: 

Normally I wouldn't suggest tables... but this case would fit a table quite nicely.

I'd forgo dotted lines as they would be very bad for usability (if you've got a page of dotted lines, it's very cluttered and hard to follow each one - you'd probably use your finger on the screen like you would a menu - not good).

Instead why not a table with alternate row colours, which might look quite nice. Then have a rollover state that would highlight the whole row, to make it completely obvious for the user what each item costs.

There's a great example tutorial with code here (see example 3): http://bit.ly/9jTnAx

The code is at the bottom of the page, and is pretty much just copy paste from your end.

Good luck!

Nelga