Answer the question
In order to leave comments, you need to log in
[Code Review]. Who can check, evaluate the code and tell about the mistakes made, where it is worth changing, in the future not to allow?
Hello! I started doing layout two months or so ago. For the most part, I watched a video, read something, or asked questions here when I could not do / understand something on my own. Sometimes I tried to repeat after the authors on YouTube. Nevertheless, it didn’t work out for a long time, I wanted to write the code myself.
Now he began to practice and typeset using layouts. I guess I'll move on to learning more and learn the WordPress CMS, as well as JavaScript to spice up the pages.
The problem is that before that I would like to make at least four layouts in order to make sure that I learned the information.
At present, I have made up the first two layouts and decided to ask to see the code and say where and what mistakes were made, so that they would not become boring and would not be allowed in the future. Thanks in advance to those who respond.
First laid out site - https://deokti.github.io/GRANIT/
( Its structure )
Answer the question
In order to leave comments, you need to log in
Let's try to evaluate your first site and write that I would recommend doing it in addition to what is:
1. Reduce the page size. At the moment, at the first download, it weighs 1.4 MB, which is a lot. Especially if you go from the mobile Internet. Literally, if you reduce the weight of two pictures, you can save a lot on page size. An excellent resource for reducing the size of pictures . The first BG picture can be reduced from 500kb to 100kb, the map picture can be reduced from 360kb to 50kb. If you go straight ahead, you can even think about using the WebP format, or try to fasten the lazyload.
2. Take for example a block with the class .nav-bg. There are a lot of media queries applied that change its width. It's redundant. It's easier to make this block stretch to the width of its parent ( width: 100% ) and you wouldn't have to redefine the width of this container every 50-200px. This will speed up development and simplify support in the future.
You can immediately tell about the block with the .container class , which has exactly the same trouble with media queries. Its width changes a lot and very often, although in fact it can be set once and not redefined again (at least within the current site). I’ll also say right away that it’s not very correct to set the width rigidly (clearly indicate percentages). It's better to do it as a percentage. I.e:
.contatiner {
max-width: 980px;
margin: 0 auto;
}
.nav-bg {
width: 100%; // в таком случае ваше меню всегда будет равно ширине контейнера и не надо будет париться
}
<p>
<div>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question