css - adjusting div position -


How can I adjust the div with the right center of the screen at any resolution with the condition: complete. ??

If the div has the width and height known, you can use the negative margin:

  div {status: complete; Width: 800 pixels; Height: 500px; Left: 50%; Top: 50%; Margin-top: -250px; Margin-left: -400px; }  

The negative margins are half of width and height.

If the size of the div is not known or the liquid is, then you have to use javascript. How is it that it is working using jQuery:

  $ (function () {$ (window). Reset (function () {$ ('div.something'). CSS ({Left: $ (): ($ () ($ (this). Wide () / 2), top: $ (window) .hite () - ($ (this) .height () / 2)} )}}); $ (Window) .resize ();});  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -