+ 2
Many Question about css (please help)
Hey everyone,i have some trouble about css code.I want to ask my trouble and some Question about css 1.How to count padding and margin to make box model of html.Im very confuse of this 2.What the different beetwin tag article and section 3.To make box,is border one choose to make box model of html 4.What is em value ? thanks everyone,hope i can know the answer and can make website easy
5 Answers
+ 3
you need to do in the css just {box-sizing:border-box } you can raise it with the padding.
+ 2
1. Margin is spacing between the element (box) and other elements or its container, padding is between the box and what's inside it (another element or text, for instance).
2. Article could be used to contain an article or blog post ( the whole piece) and the section could be used to seperate each subsection or thought of the post. For instance, a blog on web development could be in article tags and the sections on HTML, CSS and JS could each be in section tags.
3. The box model is really just a way of understanding certain properties of elements. You dont create a box model, you use the idea to make sense of the often confusing properties. The border can be used to visualize the box. Just add a 2px solid black border to an element and see how the properties space it from other elements and its contents.
4. em is a relative measure of font size. If an element has a default size and you want some text to be twice the size, just use 2em and you have it. It can be easier that knowing the px size and doubling it.
0
hi my answer is for the 4th question the the em tag does not have a specific values if only helps to emphasize of bold the text in HTML document
0
when you don't put a value ,the browser applies the default value of 16px , em is a relative size unit,
(em = pixels/16 ) used to resize the text .
0
. The box model is really just a way of understanding certain properties of elements. You dont create a box model, you use the idea to make sense of the often confusing properties. The border can be used to visualize the box. Just add a 2px solid black border to an element and see how the properties space it from other elements and its contents.