MCQs Test!! VB Basic Test !! Essentials of VB !! Creating User Services !! function !! Anatomy !! GK March-2019 !! DATA TYPES IN JAVA !! Classes ,Constructor ,Methods,Inheritance !! Ecology-I !! Biology 2019 !! Gk april 2019 !! Biology (living world) !! Plant anatomy !! CELL STRUCTURES AND FUNCTION !! General biology !! Human physiology !! Data structure !! Ecology-II !! GK TEST !! Reproduction in plants !! Human reproduction !! The ABC of C !! Operating system set1 !! Operating system set2 !! Gk and current affairs !! Animal kingdom !! Number system !! Animal kingdom-II !! Gk TEST-III !! Number series !! Microorganisms !! Interview question in c !! Time and Work !! Percentage !! General history !! Average !! Cells !! Locomotion and Movement !! paging !! Bacteriology !! Page replacement policy !! Secondary memory and Disk scheduling !! Introduction of Nervous System and neurons !! Plant harmones !! Transport and Mineral Nutrition in Plants !! Neurotransmitters !! Modern Indian History !! Photosynthesis in Plants !! Modern Indian History-II !! Plant respiration !! Environment & Biodiversity !! Environment & Biodiversity - II !! Algae, Bryophytes, Pteridophytes !! Area !! Cricket !! Days of the Year (India and the World) !! Plant Pathology - I !! Indian Transport System !! Plant Pathology - II !! Aptitude !! Biology !! Botany !! C language !! Computer Science !! Core Java !! Gate !! GK !! Mysql !! Operating system !! Physics !! VB-Visual Basic !! Zoology

CSS Tutorials

Padding In CSS
Previous Home Next

A padding is the space between an element's border and the content within it.The padding clears an area around the content (inside the border) of an element. The padding is affected by the background color of the element.

The top, right, bottom, and left padding can be changed independently using separate properties. A shorthand padding property can also be used, to change all paddings at once. The padding CSS property sets the required padding space on all sides of an element. The padding area is the space between the content of the element and its border. Negative values are not allowed.

The padding property in CSS defines the innermost portion of the box model, creating space around an element's content, inside of any defined margins and/or borders.Most of the rules for margins also apply to padding, except there is no "auto" value, and negative values cannot be declared for padding.

CSS Code

padding-top: length percentage; 
padding-left: length percentage;
padding-right: length percentage;
padding-bottom: length percentage;

In the above css code have 2 choices of values for the padding property:

  • length
  • percentage

You can also declare all the padding of an element in a single property as follows:

padding: 20px 20px 20px 20px;

 

If you declare all 4 values as I have above, the order is as follows:

  1. top
  2. right
  3. bottom
  4. left
Simple example
<html>
<head>
<style>
p.padding {
font:"Times New Roman", Times, serif;
background-color:#CCCCCC;
padding-left:10px;
padding-right:10px;
padding-top:20px;
padding-bottom:20px;
}
</style>
</head>
<body>
<p class="padding">Example of padding</p>
</body>
</html>

Output

Previous Home Next