jaycode
jaycode

Reputation: 2958

css clear in safari and chrome creates an extra line, not in firefox

Adding clear: left, clear: right, or clear:both to an element would create an extra carriage return in Firefox, but not in Chrome and Safari, it is very frustrating, anyone know how to fix this?

Upvotes: 0

Views: 1208

Answers (2)

Ast Derek
Ast Derek

Reputation: 2729

.clear-nobr {clear:both;line-height:0!important;font-size:0!important;}

Upvotes: 1

DisgruntledGoat
DisgruntledGoat

Reputation: 72550

If you are adding the style to the line break tag (<br>) then this will add a line break as should be expected. You could try using a div instead since they have zero height when there is no content:

<div style="clear:both"></div>

Upvotes: 0

Related Questions