Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line break (<br/>) within a header (<h2>) tag

Tags:

html

css

Inserting a br tag within a header tag (e.g. h2) inserts a space after the first word.

How do I remove that space as I am right-aligning the text?

e.g.

<h2>
    hello
    <br/>
    world
</h2>

http://jsfiddle.net/4er7r/

like image 438
Coderama Avatar asked Dec 06 '22 03:12

Coderama


1 Answers

It isn't the br tag itself, but the returns surrounding it. They are translated to whitespace. Use this:

<h2>
    hello<br/>world
</h2>

http://jsfiddle.net/4er7r/3/

like image 56
GolezTrol Avatar answered Dec 08 '22 16:12

GolezTrol