This is my code
<style>
.className{
width:55%;
height:auto;
margin:0 auto;
}
body{
text-align:center;
}
</style>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(window).resize(function(){
$('.className').css({
position:'absolute',
left: ($(window).width() - $('.className').outerWidth())/2,
top: ($(window).height() - $('.className').outerHeight())/2
});
});
// To initially run the function:
$(window).resize();
});
</script>
When I open my page i see my DIV not centred, but when i reduce and i reopen in full mod the window of my browser, the DIV is perfectly centred, plz help me I'm going crazy