On 18.11.2010 22:34, John wrote:
Hello;
This is related to my question yesterday about proper use of div tags...
I now get that an ID must be used only once on a page. Within div tags
(from code generously provided here) I've been able to format specific
bits of content, like text, using classes and <span> tags.
But I'd like to ad a dotted line between to paragraphs, and that seems
to me to be a block-level tag required to do it. Is this correct?
Paragraphs and headlines are block elements, and, yes, of course you can
put any type of block-level elements inside divs.
No need to add extra markup for adding decorative lines and separators
though. Add a little extra padding at the bottom or top of one of the
paragraphs you want to split a bit, and put a dotted border-line on that
paragraph. Adjust padding/margin on those paragraphs for a nice line-up.
Another method is to add a background to the expanded top or bottom
padding on paragraphs. I haven't documented it anywhere (AICR), but this
page...
<http://www.gunlaug.no/contents/molly_1_25.html>
...shows pretty clearly how I have added "a cat" and a "---***---" line
to selected paragraphs using a dedicated class, to create spaces between
paragraphs. No extra elements in markup, only a class and a few lines of
"reusable" CSS in the stylesheet.
Can I throw in a <br> and apply a border-bottom to that or is that
considered bad coding?
A <br> won't take such styling. <br> is "line-break" and nothing else.
You are probably thinking about <hr> - "horizontal ruler...
<http://www.gunlaug.no/contents/wd_chaos_30.html>
...and sure, you can use <hr> but it isn't always easy to make it look
right or the same across browser-land.
<br> (line-break) is best reserved for breaking lines within paragraphs,
and only where it makes sense for the text and doesn't start looking odd
if someone apply font-resizing.
regards
Georg
______________________________________________________________________
css-discuss [cs...@lists.css-discuss.org]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/