JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<title>Draw someting</title>
<body>
<div class="className" >
<p>Centered In The Middle Of The Page With jQuery</p>
</div>
</body>
CSS
body {
margin: 0;
padding: 0;
width: 100%;
}
.className{
position:absolute;
}
JavaScript
$(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();
});