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

Box Model In CSS
Previous Home Next

All HTML elements can be considered as boxes. In CSS, the term "box model" is used when talking about design and layout. The CSS box model is essentially a box that wraps around HTML elements.In CSS, the term box model is used when talking about design and layout of the HTML webpage;

    This consists of three types:

  1. Margin: Clears an area outside the border.The margin represents the distance between the outer edge of the border and any neighboring elements. This is often a source of confusion as it’s easy to think of the margin as a kind of “padding” between elements. Better to think of it like the margin of a page, it represents the outer edge of the object.

  2. Syntax:

    margin: <margin-top>
  3. Padding: Padding specifies the spacing between the border and any content within the HTML element. If there’s no visible border, then the extent of the padding is effectively the extent of the element. Any background CSS properties associated with the element are displayed within the area defined by the border and padding properties.

  4. Syntax:

    padding: <padding-top>
  5. Border: The border represents the effective outer limit of the element itself. The border can be either visible or invisible, and has properties for line type, color, and width.A border that goes around the padding and content.

  6. Content: The content of the box, where text and images appear.


Simple Example
<TITLE>Examples of margins, padding, and borders</TITLE>
<STYLE type="text/css">
UL { 
margin: 12px 12px 12px 12px;
padding: 5px 5px 5px 5px;
LI {  
margin: 12px 12px 12px 12px ;
padding: 12px 0px 12px 12px;
font:Arial, Helvetica, sans-serif; 
LI.withborder {
border-width: medium;
<LI class="withborder">Element of list is
 a bit longer to illustrate wrapping.</LI>


Previous Home Next