0
If the padding tag is used to customise the height of the div element , what is used for its width?
5 odpowiedzi
+ 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
+ 1
no padding tag is not used to costomise the height of the tag
+ 1
in CSS you need to type the
height and width tag is used to change the height
+ 1
the first one will have 20px padding around it and second one will have 50px padding around it
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>