hjrshng
hjrshng

Reputation: 1826

Line breaks causes spaces in the html

In my PhpStorm 7, line breaking some elements (every elements) like this:

<input type="text">
<input type="text">
<input type="text">

Causes some space between the tags in my rendered html page (with all navigators) and breaks all my grids:

enter image description here

I reseted all margins, etc.. so i have 0 margins or something else in my css.

When i put them on the same line, the spaces are gone:

<input type="text"><input type="text"><input type="text">


enter image description here

In my inspector (no margins, just padding and a thin border). And they have all default css:
enter image description here
enter image description here

I just can't find how to configure it. It's a CakePHP view.

Upvotes: 4

Views: 5485

Answers (1)

Ian Bytchek
Ian Bytchek

Reputation: 9085

This is a common issue with the whitespace and how it's handled by browsers. There are many similar questions and answers, like this one.

Basically you can use display: block and float: left or if you are using a template rendering engine, they may provide helpers for removing the whitespace, like {strip} in Smarty or {% spaceless %} in Twig. There are other ways to achieve this in HTML, google and search SO.

Upvotes: 4

Related Questions