'padding-left' Example : padding left « CSS « HTML / CSS






'padding-left' Example

  
    
<html>
<body>
<table>
    <tr>
        <td id="myTd">
            <img src="http://www.java2s.com/style/logo.png" height="100" width="100" border="5">
        </td>
    </tr>
</table>
<button onclick="myTd.style.paddingLeft=0">Set padding to 0</button>
<button onclick="myTd.style.paddingLeft=20">Set padding to 20</button>
</body>
</html>

    
      
        
    
  








Related examples in the same category

1.padding-left: 0px
2.padding-left: 8px;
3.padding-left: 1.5em;
4.padding-left: 1cm; padding-right: .5cm;
5.Independently set padding-left, padding-right, padding-top, and padding-bottom.
6.The element's background is displayed in the padding area.
7.padding:0 is the default.
8.Combine negative text-indent and padding-left