If I set width:100px for some element, is it contain padding, border and margin? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 6

If I set width:100px for some element, is it contain padding, border and margin?

28th Nov 2018, 3:48 AM
Nodir Xakimov
Nodir Xakimov - avatar
6 Answers
+ 9
No.The width will be excluding padding,margin,border.To include padding and margin in specified width you can use : box-sizing:border-box
28th Nov 2018, 9:55 AM
Mitali
Mitali - avatar
+ 5
There is no padding border or margin if you dont set it ok its only have width
29th Nov 2018, 4:28 PM
Atif Saleem 🇵🇰
Atif Saleem 🇵🇰 - avatar
+ 2
No, it won't contain!! You have to add others property separately!! https://code.sololearn.com/WrNb7AJaV97y/?ref=app
28th Nov 2018, 4:03 AM
AL Araf
AL Araf - avatar
28th Nov 2018, 5:20 AM
Janning⭐
Janning⭐ - avatar
0
Only width would be defined by that if I do recall.
7th Dec 2018, 10:37 PM
Nicholas Quinn
- 4
Gab
28th Nov 2018, 6:54 PM
Hendra
Hendra - avatar