/    Sign up×
Community /Pin to ProfileBookmark

How can i control the hieght of <BR>

How can I control the height of <BR>?

at the moment br creates more space between lines than I want and I prefer not to use line-height in <P> tags.

to post a comment
CSS

9 Comments(s)

Copy linkTweet thisAlerts:
@patch2112Jun 28.2005 — Hello,

I'm no expert at CSS as far as compatibility, but I have created a style like...
[CODE].spacer {
line-height: 5px;
}[/CODE]

and then put the <br> in a span...
[code=html]<span class="spacer"><br></span>[/code]
and that worked for me. Just adjust the line-height.

Philip
Copy linkTweet thisAlerts:
@amahmoodauthorJun 29.2005 — Thanks patch2112

I tried your code as follow but I didn't see any effect.

[code=php] <STYLE>
.spacer {
line-height: 25px;
}
</STYLE>

Line one<span class="spacer"><br></span>
Line two<span class="spacer"><br></span>
Line three<span class="spacer"><br></span>
Line four [/code]
Copy linkTweet thisAlerts:
@IncaWarriorJun 29.2005 — do you have to use <br /> to make the space? You can't use a list or anything good like that?

Anyways, for that use it looks more like you want to use line-hieght for all the text. br only breaks the line, it doesn't actually create space unless you put two of them (then it just makes another blank line).
Copy linkTweet thisAlerts:
@patch2112Jun 29.2005 — A <br> at the end of text doesn't add a line. Try this...

Here is some text<br>

<span class="spacer"><br></span>
Copy linkTweet thisAlerts:
@ray326Jun 29.2005 — What do your lines actually represent? They look like a list to me.
Copy linkTweet thisAlerts:
@deraJun 29.2005 — A <br> at the end of text doesn't add a line. Try this...

Here is some text<br>

<span class="spacer"><br></span>[/QUOTE]

use <br />
Copy linkTweet thisAlerts:
@KorJun 29.2005 — you may use the CSS [b]margin[/b] attribute to introduce a controled space between elements:

text

<p style="margin-top:14px"></p>

text
Copy linkTweet thisAlerts:
@toicontienJun 29.2005 — What exactly are you trying to accomplish with the line breaks? If each line is a separate item, then use a list:

<i>
</i>&lt;ul&gt;
&lt;li&gt;one&lt;/li&gt;
&lt;li&gt;two&lt;/li&gt;
&lt;li&gt;three&lt;/li&gt;
&lt;li&gt;four&lt;/li&gt;
&lt;li&gt;five&lt;/li&gt;
&lt;/ul&gt;

Then use the appropriate CSS to make it look the way you want. Most importantly, we either need to see the HTML and CSS, or a screenshot of what you want to create. The fact is there are a hundred ways to skin this cat, and not all the ways work best for you.
Copy linkTweet thisAlerts:
@NogDogJun 29.2005 — use <br />[/QUOTE]
Only if you're using a XHTML doctype. <br> is correct for a HTML doctype (though not necessarily the best way to do things in this case).
×

Success!

Help @amahmood spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...