V
V
vs-vs2022-01-14 22:28:57
Design
vs-vs, 2022-01-14 22:28:57

When working with a grid, should the size of the frame be taken into account?

Hello.
I draw with a grid and the question arose,
Block 340px, in the block 3 photos with a width of 110px and an indent between the photo 3px (and that 330 + 6px) = 336px
We need a block frame, 4px remains, that is, the frame will be 2px.
The question is, should the block be 340px + frame or 336 + frame, and how does it work out taking into account the 340px frame?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Shamanov, 2022-01-14
@SilenceOfWinter

depends on the context:
1.

By default, it sets the width of the content area, but if "box-sizing" is set to "border-box", it sets the width of the border area.

2. document type htmlbook.ru/css/width
3. width in js dom may not match css width

E
Evgeny Golubev, 2022-01-30
@bestowhope

The question "how should it be" is incorrect. Should be the way you want it.
Both options can be implemented. I would do the 2nd. Fortunately, css allows you to make strokes inside
htmlbook.ru/css/outline-offset

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question