If the padding tag is used to customise the height of the div element , what is used for its width? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If the padding tag is used to customise the height of the div element , what is used for its width?

25th Sep 2017, 1:01 PM
ALAINGIRESSE ETONGO
ALAINGIRESSE ETONGO - avatar
5 Answers
+ 15
Hi @Alaingiresse 👋☺! The padding property is not used to customise the height nor width of a div element; it is used to generate space around the "Content" area. You can think of it as an internal margin. And you can control and set the padding for each side of an element, I mean individually, for example using "padding-left", "padding-right", "padding-top" and "padding-bottom". I think it's important that you study more about the "Box Model", understanding this is key to position elements correctly, you can read more about it here: https://www.w3schools.com/css/css_boxmodel.asp
28th Sep 2017, 3:51 AM
Pao
Pao - avatar
+ 1
no padding tag is not used to costomise the height of the tag
26th Sep 2017, 1:49 AM
Ashwath V K
Ashwath V K - avatar
+ 1
in CSS you need to type the height and width tag is used to change the height
26th Sep 2017, 1:50 AM
Ashwath V K
Ashwath V K - avatar
+ 1
the first one will have 20px padding around it and second one will have 50px padding around it
1st Oct 2017, 4:40 PM
Ashwath V K
Ashwath V K - avatar
0
@Ashwath. What can you say about this codes <html> <body> <h1>Headline</h1> <div style="background-color:green; color:white; padding:20px;"> <p>Some paragraph text goes here.</p> <p>Another paragraph goes here.</p> </div> </body> </html> And <html> <body> <h1>Headline</h1> <div style="background-color:green; color:white; padding:50px;"> <p>Some paragraph text goes here.</p> <p>Another paragraph goes here.</p> </div> </body> </html>
28th Sep 2017, 9:02 AM
ALAINGIRESSE ETONGO
ALAINGIRESSE ETONGO - avatar