N
N
nesipe2015-08-27 15:23:25
css
nesipe, 2015-08-27 15:23:25

What is the best way to edit style?

Good day.
How to edit the style more competently, or rather, edit individual elements. For example, we have a picture, put it between 2 blocks, and of course it turns out not to be where I would like it to be. Naturally, I start moving it. So the question is: How can such individual elements be moved more competently? Add a class called .fixImage? Get to it through all the parents and add nothing? Maybe there are other approaches? I don’t really understand css, I focus more on php, but my heart is not calm when something is done through one place :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mak Alexey, 2015-08-27
@nesipe

and of course she is not there
Why "of course"? Did you expect such an outcome?
And if we are talking about a separate element, then I would recommend using id and not classes.
HTML:
CSS: It's
best to avoid inserting crutches like this.
Let's assume that you have figuratively imagined in your head what the page will look like.
You must understand which elements will have certain geometric parameters.
Now imagine that the content in each block is dynamic. That is, you do not know in advance what size it will be. Proceed from these considerations and adapt the layout to your template.
In this case, the layout will not float and glitch, and the code for the parameters will already be sewn into the template.
Of course, this option requires more time and knowledge of CSS, but with this approach you will save yourself from future problems. You will gain valuable experience, and you will be helped to answer your questions here.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question