Banath Posted October 19, 2013 Share Posted October 19, 2013 (edited) I am attempting a practice assignment and it calls for the use of definition lists. I don't think this is covered in the course, but maybe someone can help. This is what I want to achieve: http://clouni.com/assignments/HTML5-Assignment.pdf (It is assignment 4). It should appear this way (The red represents the problem area): Fruit Apples, Oranges, Pears, Pineapples Vegetables Corn on the cob cream Carrots Green Beans <dl> <dt><u>Fruit</u></dt> <dd>Apples, Oranges, Pears, Pineapples</dd> <dt><u>Vegetables</u></dt> <dd>Corn</dd> <dd><em>on the cob</em></dd> <dd><em>cream</em></dd> <dd>Carrots</dd> <dd>Green Beans</dd> </dl> </dl> Edited October 19, 2013 by Banath Link to comment Share on other sites More sharing options...
niche Posted October 19, 2013 Share Posted October 19, 2013 What's the problem? Link to comment Share on other sites More sharing options...
Ingolme Posted October 19, 2013 Share Posted October 19, 2013 I'd structure it this way: <dl> <dt>Vegetables</dt> <dd> <dl> <dt>Corn</dt> <dd>On the cob</dd> <dd>Cream</dd> </dl> </dd></dl> Don't use <u> or <em> to style things. Use class names and selectors to target elements and style them with CSS. Link to comment Share on other sites More sharing options...
davej Posted October 19, 2013 Share Posted October 19, 2013 (edited) Maybe... <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>title</title><style>dl.top > dt{text-decoration: underline;color:red;}dl dd dl dd{font-style:italic;color:blue;}</style></head><body><dl class="top"> <dt>Fruit</dt> <dd>Apples, Oranges, Pears, Pineapples</dd> <dt>Vegetables</dt> <dd> <dl> <dt>Corn</dt> <dd>on the cob</dd> <dd>cream</dd> </dl> </dd> <dd>Carrots</dd> <dd>Green Beans</dd></dl></body></html> Edited October 19, 2013 by davej Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now