Skip to content

Line breaks in HTML wrecks labels' horizontal size and spacing #14081

@Yardboy

Description

@Yardboy

The two snippets below are identical except for the line breaks around the content, yet they produce different output in the browser. The line breaks in the second snippet affect the horizontal spacing of the labels, as shown in the images below.

It specifically seems to be related to the line break that comes AFTER the content, as demonstrated here: http://jsbin.com/dufiquge/1/edit?html,output.

<div class='label label-primary'>label 1</div>
<div class='label label-info'>label 2</div>
<div class='label label-success'>label 3</div>
<div class='label label-primary'>
  Label 1
</div>
<div class='label label-info'>
  Label 2
</div>
<div class='label label-success'>
  Label 3
</div>

buttons1

buttons2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions