No replies
Cupidvogel
Cupidvogel's picture
Offline
newbie
Last seen: 9 years 32 weeks ago
Timezone: GMT+5.5
Joined: 2011-02-12
Posts: 1
Points: 2

Hi. This is a code I have written:

<html>
<body>
<p class="padding">This is a paragraph with a cool specified paddings.</p>
</body>
</html>

This is combines with the following CSS style:

p.padding
{
padding-top:25px;
padding-bottom:35px;
padding-right:0px;
padding-left:15px;
width: 40%;
height:10%;
}

The problem is that when I remove the four padding specifications, the paragraph assumes a height and width as specified in the last two lines. However, with the padding specifications included, the height and width of the para change noticeably. Looks like the padding specifications and size properties (height and width) of the para are colliding head-on, and the former wins, so that the latter have to accommodate to keep the former intact. Why is it so? Is it possible to continually change the padding (thus the content may be compressed, to the point of completely overlapping each other) without affecting the height or width of the para?