JSFiddle - React, Tailwind, and code Playground
by tmyie
HTML
<div class="container">
<div class="nav">
<a class="about" href="#about"> abasdasdaout</a>
<a class="search" href="#search">search</a>
<a class="contact" href="#contact">contact</a>
</div>
</div>
CSS
.container {
height: 500px;
width: 500px;
background-color: lightgrey;
position: relative;
}
.nav {
border: 1px solid red;
}
JavaScript
var nav = $('.nav').css('position', 'absolute');
nav.css({
'left': '50%',
'top': '50%',
'margin-left': -nav.outerWidth() / 2,
'margin-top': -nav.outerHeight() / 2
});