#297548 - 24/04/2007 23:29
Re: HTML, UL, LI, and BR ?
[Re: tfabris]
|
veteran
Registered: 21/01/2002
Posts: 1380
Loc: Erie, CO
|
Quote: Okay, let's say I have to insert my list of items into someone else's document that already has a style defined that controls the line heights. I just want a consistent number of carriage returns. What is the correct HTML for that?
Like Bitt said, you can use inline styles. Any element can contain a style attribute, and it overrides the stylesheet. You can control line height with the line-height style, but don't confuse line-height with margins around a list item. line-height will control the height between lines in the same list item (if you have several lines of text within a <li>), margin, border and padding control the block element's (in this case, the li) spacing.
To see a good demo of the box model for block elements (almost anything in HTML is a block element, a <div> a <table> a <li>), see this page. In your case, you probably just want to add space at the bottom of each list item. Use margin-bottom for that, or the margin shorthand like I have above:
margin: top right bottom left;
To set only the bottom height to be 2 times the size of the current font, use either:
margin-bottom: 2em;
or
margin: 0em 0em 2em 0em;
The shortcut makes it easy to tweak margins later, you won't have to add margin-top, margin-left, etc. I suggest taking a look at CSS Basics, it's a good reference.
|
Top
|
|
|
|
HTML, UL, LI, and BR ?
|
tfabris
|
24/04/2007 17:42
|
Re: HTML, UL, LI, and BR ?
|
tfabris
|
24/04/2007 17:49
|
Re: HTML, UL, LI, and BR ?
|
cushman
|
24/04/2007 18:08
|
Re: HTML, UL, LI, and BR ?
|
tfabris
|
24/04/2007 18:27
|
Re: HTML, UL, LI, and BR ?
|
cushman
|
24/04/2007 18:48
|
Re: HTML, UL, LI, and BR ?
|
cushman
|
24/04/2007 19:01
|
Re: HTML, UL, LI, and BR ?
|
tfabris
|
24/04/2007 20:04
|
Re: HTML, UL, LI, and BR ?
|
wfaulk
|
24/04/2007 20:06
|
Re: HTML, UL, LI, and BR ?
|
cushman
|
24/04/2007 23:29
|
Re: HTML, UL, LI, and BR ?
|
hybrid8
|
25/04/2007 00:44
|
Re: HTML, UL, LI, and BR ?
|
hybrid8
|
24/04/2007 19:40
|
|
|
|