I am trying to right align a UL within a div. The goal is to have a responsive navbar wherein a change in the size of the div will lead to the UL within it moving in the opposite direction so as not to fall out of view.
However i end up with the following if i narrow area from right to left:
Ideally should stay like this:
My css:
.navbar {
float: left;
width: 20%;
height: 2000px;
font: 600 1.25em/1.38 'Josefin Slab';
background-color: rgb(246, 84, 84);
}
.navbar .text {
float: left;
min-height: 39px;
font-size: 1em;
color: rgb(255, 255, 255);
}
.navbar .text-1{
margin-top: 50%;
}
.navbar .text {
clear: both;
width: 31.9157778085%;
flex:1;
margin-left:47%;
}
.navbar .navwrapper{
display:flex;
/*set direction every browser*/
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
-webkit-box-orient: vertical;
-moz-box-orient: vertical;
-webkit-flex-direction: column;
-ms-flex-direction: column;
flex-direction: column;
flex-wrap:wrap;
}
.navbar .text:hover{
text-shadow: 2px 5px 5px rgba(0, 0, 0, .5);
}
@import url(http://fonts.googleapis.com/css?family=Josefin+Slab:600);
The HTML:
<div className="navbar clearfix">
<ul className="navwrapper">
<Link to="/" id="Home" className="text text-1">Home</Link>
<Link to="/Training" id="Training" className="text text-2">Training</Link>
<Link to="/Contributions" id="Contribute" className="text text-3">Contribute</Link>
<Link to="/Info" id="Info" className="text text-4">Info</Link>
<Link to="/About" id="About" className="text text-5">About</Link>
</ul>
</div>