Page 106 - DCAP408_WEB_PROGRAMMING
P. 106

Web Programming




                    Notes                  bottom padding is 75px
                                           left padding is 100px
                                      padding:25px 50px 75px;
                                           top padding is 25px

                                           right and left paddings are 50px
                                           bottom padding is 75px
                                      padding:25px 50px;

                                           top and bottom paddings are 25px
                                           right and left paddings are 50px
                                      padding:25px;
                                           all four paddings are 25px

                                   All CSS Padding Properties

                                   Property        Description
                                   padding         A shorthand property for setting all the padding properties in one declaration

                                   padding-bottom  Sets the bottom padding of an element
                                   padding-left    Sets the left padding of an element
                                   padding-right   Sets the right padding of an element
                                   padding-top     Sets the top padding of an element


                                          Example: How to set all the padding properties in one declaration
                                   Source code:

                                   <html>
                                   <head>
                                   <style type="text/css">

                                   p.ex1 {padding:2cm;}
                                   p.ex2 {padding:0.5cm 3cm;}
                                   </style>
                                   </head>

                                   <body>
                                   <p class="ex1">This text has equal padding on each side. The padding on each
                                   side is 2cm.</p>

                                   <p class="ex2">This text has a top and bottom padding of 0.5cm and a left
                                   and right padding of 3cm.</p>
                                   </body>

                                   </html>




          100                               LOVELY PROFESSIONAL UNIVERSITY
   101   102   103   104   105   106   107   108   109   110   111