[Content]
Using CSS and semantics to build a restaurant menu
When out having a meal with a few guys from work once we got talking about the menu, and how it would be intereting to work on a restaurant website in terms of using semantics and CSS to build menus properly. When I got in that night I had a spare few minutes and came up with the following lightweight and semantic xHTML with a sprinkle of CSS:
The Menu
- Shitake, Portobello, button mushrooms (v) £10.50
- & leeks with blue cheese guacamole & home-made salsa
- Chicken fillet strips £12.50
- with lemon & paprika, creamy guacamole & home-made salsa
- Flame-grilled sirloin steak £13.50
- with horseradish guacamole & salsa Criollo
Markup
<dl>
<dt>
<strong>Shitake, Portobello, button mushrooms (v)</strong>
<span>£10.50</span>
</dt>
<dd>& leeks with blue cheese guacamole & home-made salsa</dd>
<dt>
<strong>Chicken fillet strips</strong>
<span>£12.50</span>
</dt>
<dd>with lemon & paprika, creamy guacamole & home-made salsa</dd>
<dt>
<strong>Flame-grilled sirloin steak</strong>
<span>£13.50</span>
</dt>
<dd>with horseradish guacamole & salsa Criollo</dd>
</dl>
CSS
dt{
position:relative;
background:url(images/dot.gif) bottom left repeat-x;
}
dt strong{
background:#fff;
font-weight:bold;
padding:0.1em 0.3em 0.2em 0;
}
dt span{
position:absolute;
right:0;
background:#fff;
padding:0.1em 0 0.2em 0.3em;
}
Adding PHP
Further to a discussion on a web design form I decided to integrate some PHP with this to build it dynamically.
Web Design+
Typogridphy
Clecktionary