View Full Version : What spacing methods do you use?

12-11-2010, 04:17 AM
What spacing methods do you use for basic text and image sections of your site? For example, in my main content, I usually use two <br>s to put some space between the article and an image/video. Sometimes I use a combination of <p> and <br> instead of setting up a CSS style since I vary the amount.

Anything wrong with that method?

12-11-2010, 05:12 AM
Hello cineweekly.com,
The semantic approach is for markup to contian the information and CSS to style it.
Empty p tags and breaks are not information.

12-11-2010, 12:00 PM
i use </BR> tag for break the line.

12-12-2010, 02:47 AM
Empty p tags are not valid, but you can add upto 2 <br> tags, to be valid, any more and you need to use CSS I read somewhere.

12-12-2010, 06:36 AM
Can anyone find a source that says two <br> tags are valid? That could really be useful when IE adds too much blank space to <p>'s, I can just use two <br>s sometimes.

12-12-2010, 10:36 AM
That could really be useful when IE adds too much blank space to <p>'s, I can just use two <br>s sometimes.

Or, you could just use CSS to style the p tag.
You can put however much or little space you want on any p tag you care to.

I keep saying, there is no need to try controlling the layout with HTML.

Two <br />'s may be valid code but that doesn't make it semantic.

12-12-2010, 01:37 PM
Something about <br>tags are not semantic text and should be used sparingly.

I cannot find the teachings that suggested I only use 2 <br> tags, but the WC3 recommends using <br> for only a br line and not to create a paragraph.

12-12-2010, 02:28 PM
I think it's better to use CSS than put a number of <br> tags in your code. You can use a lot of CSS methods = margings, padding, etc.

12-12-2010, 06:39 PM
But I never know what content will be above or below a <p> so I don't know how much space is needed until I create that content. I don't want to end up with a 20 css styles for various margin spacings.

Other than that I do have a generic margin/padding set for <p> and various classes of <p>.

12-12-2010, 07:10 PM
2 breaks are not too bad semantically.
I always style my paragraphs with

p {margin-bottom: 15px;}

and you could then add a class for the top of some p tags if needed, other than that there is not really anything else to say about them, as p tags are what they are and so are break tags