jquery - Float div to right with margin right at any screen size -


i have background image (size of image 2600x1170)

sbbody {     background: #999 url(footer_bg.jpg) center top no-repeat;     overflow-y: scroll;     overflow-x: hidden;     height: 1105px;     font-family: serif, georgia, times new roman, times;     font-size: 12px; } 

i have special area @ image (on right side of image), , need show special div should @ area, did float right , margin

.main_box {     float: right;     margin-right: 505px;     margin-top: 75px; } 

it looks fine in screen resolution 1900x1200, if change browser size margin div broke. how can have same div position until browser window more 800px;

<body class="sbbody">     <div class="main_box">     </div> </body> 

thanks.

as floating div right, need fix background top , right using :

background-position:top right; 

instead of top center

see demo

css :

.sbbody {     background: #999 url(http://lorempixel.com/output/nature-q-g-1280-720-10.jpg) right top no-repeat;     overflow-y: scroll;     overflow-x: hidden;     height: 1105px;     font-family: serif, georgia, times new roman, times;     font-size: 12px; } .main_box {     float: right;     margin-right: 505px;     margin-top: 75px;     background:gold;  } 

Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -