How to create line spaces

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
methos
Forum Newbie
Posts: 13
Joined: Sat Oct 21, 2006 8:31 am

How to create line spaces

Post by methos »

How can I create a line space inside a <h2> ?

I normally use this method but it is incorrect since you cannot have two consecutive "<br />".

Code: Select all

<h1>title</h1>
<h2>The paragraph should not have consecutive line breaks.<br /><br />But I cannot find an answer to this problem.<br /><br />Can you help me?</h2>

This is also incorrect because you cannot have <p> inside <h2>:

Code: Select all

<h1>title</h1>
<h2><p>The paragraph should not have consecutive line breaks.</p><p>But I cannot find an answer to this problem.</p><p>Can you help me?</p></h2>
This is also incorrect right?

Code: Select all

<h1>title</h1>
<h2>The paragraph should not have consecutive line breaks.</h2><h2>But I cannot find an answer to this problem.</h2><h2>Can you help me?</h2>
So how can I insert line spaces without two consecutive <br /> ?
Last edited by methos on Sun Feb 25, 2007 3:13 pm, edited 1 time in total.
User avatar
Kieran Huggins
DevNet Master
Posts: 3635
Joined: Wed Dec 06, 2006 4:14 pm
Location: Toronto, Canada
Contact:

Post by Kieran Huggins »

You're using the h2 incorrectly to begin with - what you probably want is either a DIV or a SPAN that has been styled (class="subtitle" ?)
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Re: How to create line spaces

Post by nickvd »

methos wrote:I normally use this method but it is incorrect since you cannot have two consecutive "<br />".
Huh? Where the heck did you hear this? It's not even close to being true...
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Personally, I'd use a DIV tag and style <p> tags inside of it to do what you want to do.
Post Reply