css - How do I change the position of an image without it affecting the text to it's left? -


code:

<div class="container_bottom_tip">     <div class="container_bottom_desc">this text         <img class="browser_button_img" src="images/something.png">     </div> </div> 

.container_bottom_tip {     text-align: center; } .container_bottom_desc {     color: #333; } 

using code above want move image bit. when margin-top on image drags text "this text" it.

what can move image or down without affecting positioning of text "this text?"

you this:

.browser_button_img {     position: relative;     top: -10px; } 

relative positioning allow move element relative have been without affecting other elements' reflow. unlike absolute positioning, relative allows maintain normal space taken element.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -