e.g. if I say that p { min-width: 300px; } then it includes the paragraph text+its padding+its border+its margin? The whole package will be min. 300px wide?
no, it will only be the paragraph that will be min 300px wide, if we say you have a paragraph 200 px wide but with a padding of 18px, a border of 2px in width and a margin of 30px, your paragraph will be resized to 300px and therefore the box of that paragraph won’t be 300px wide but 400px wide
The height and width limits are referred to the content’s height and width, or the element’s box height and width (so content +padding + border + margin)? Just want to be sure as the following definitions were given on this exercise:
1. min-height — this property ensures a minimum height for an element’s box. 2. max-height — this property ensures a maximum height of an element’s box.
When a browser is resized by x percentage, every box-part of every element get resized proportionally?
The components included in the size of an element’s box depends on the box-sizing property in your CSS file. The default box-sizing is content-box. In this case, only the content is included in the width or height specified. The other box-sizing option is border-box. In this case, the width and height specified in your CSS includes content + padding + border. The syntax is box-sizing: border-box , or box-sizing: content-box. The border-box typically makes it easier to size elements.
You can refer to the MDN article below for details:
I’m a newbie here, but I hope someone finds this helpful.
I noticed that after the exercise is completed the page had multiple P elements layered on top of each other, I’m sure this is a mistake since this makes them practically unreadable despite completing the instructions. But when I zoomed in and enlarged the page it looked neat, but wouldn’t this mean that on smaller screens like mobiles and such it would become unreadable?
Hello everyone,
I can’t quite understand something. What is the difference with min-width, max-width, min-height, max-height and media queries please ?