D
D
Damir Konkov2016-03-21 23:52:19
css
Damir Konkov, 2016-03-21 23:52:19

Different padding between elements locally in development and on production Rails servers. Why?

Rails app.
There are two identical pieces of HTML / CSS code that are displayed differently in all browsers (chrome, safari, firefox).
In production, there is no indentation between links.
30720c9197bd4ec5a464e875538238fe.jpg
In development, they have
b533dbaec32743eebcbda9ac40102d9e.jpg
HTML / CSS code everywhere the same. This is probably more of a question for layout wizards. Since adding padding/margin-right/left produces a similar result
960db1fde4c7443ca3372528f6ad8e6a.jpgMain point : add padding in production.
The priority is slightly lower than the main one: to figure out what kind of magic it is?
UPDATE :
On the dev page there are spaces and line breaks in the source code, on the prod it is not.
This was the inconsistency, it seems like a fairly obvious solution, thanks @27cmfor what I sent in the right direction, I will rule.

Answer the question

In order to leave comments, you need to log in

6 answer(s)
C
Cat Anton, 2016-03-22
@d4mk0f

Due to what indents are obtained in the dev environment, did you look?
There are actually not many options: padding, margin, word-spacing, spaces and other whitespace characters.
If due to padding / margin / word-spacing, then figure out why they change in production.
If due to the spaces between the link tags, then figure out what cuts the spaces on the sale.
Among the suspects, first of all, check all sorts of minimizers, if any are used - they are often disabled in the dev environment and only enabled in the production environment.

W
Web Developer Blog, 2016-03-22
@Alexey_Suprun

For the first time I even come across, an interesting solution

A
Alexander Taratin, 2016-03-22
@Taraflex

For the parent block, make font-size:0;
For links, restore the font font-size: <size>;
And add indents through padding-right for links.

S
Semyon Semyonov, 2016-03-31
@man_without_face

Clear app caches

D
Dmitry Amelchenko, 2016-03-31
@i1677960

RAILS_ENV=production rake assets:precompile you can try

C
CorbenDallass, 2016-03-31
@CorbenDallass

See which styles are used in production and which are used in Dev. If there is a difference, then look at the paths in which assets are searched for in production (Rails.application.config.assets.precompile), and also check the inclusion of some files in others using directives
or
@import

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question