On an inline-block element, a positive value in margin-top expands the height of the line and a negative value shrinks it.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" > < html xmlns= "http://www.w3.org/1999/xhtml" > <head> <title></title> <style type= "text/css" > .container { width: 800 px; height: 800 px; background: pink; } * .box { float : right; overflow: auto; visibility: visible; width: auto; height: 100 px; margin: 10 px; padding: 10 px; background: red; } * .small { position: absolute; margin-top: 10 %; background: yellow; } </style> </head> < body > <div class = "container" > <img class = "small" src= "http://www.navioo.com/style/logo.png" alt= "star" /> </div> </ body > </ html >
HTML code for linking to this page:
Related in same category :