html - Horizontally align links so that they are evenly spaced within the nav -
update: sorry confusion, thought couldn't use table, apparently can.
i'm trying find out how evenly space links within nav have equal amount of space between them. have researched little , suggestions suggest using list or table, cannot use (i think).
.title { float: left; font: bold 52px moon, arial, sans-serif; margin-left: 2%; } .top { background-color: #000; color: #fff; } @font-face { font-family: moon; src: url(https://dl.dropboxusercontent.com/u/105222237/fonts/moon%20bold.otf); } @font-face { font-family: coco; src: url(https://dl.dropboxusercontent.com/u/105222237/fonts/cocopuff-regular.ttf); } nav { position: relative; display: inline-block; margin-top: 10px; outline: none; color: #fff; text-decoration: none; text-shadow: 0 0 1px rgba(255, 255, 255, 0.3); font-size: 1.35em; font-family: coco, arial; } nav a:hover, nav a:focus { outline: none; } .cl-effect-4 { padding: 0 0 5px; } .cl-effect-4 a::after { position: absolute; top: 100%; left: 0; width: 100%; height: 1px; background: #fff; content: ''; opacity: 0; -webkit-transition: height 0.3s, opacity 0.3s, -webkit-transform 0.3s; -moz-transition: height 0.3s, opacity 0.3s, -moz-transform 0.3s; transition: height 0.3s, opacity 0.3s, transform 0.3s; -webkit-transform: translatey(-10px); -moz-transform: translatey(-10px); transform: translatey(-10px); } .cl-effect-4 a:hover::after, .cl-effect-4 a:focus::after { height: 5px; opacity: 1; -webkit-transform: translatey(0px); -moz-transform: translatey(0px); transform: translatey(0px); } nav { float: left } body { background-color: black; } <div class="top"> <div class="title"> codecatek </div> <nav class="cl-effect-4"> <a href="">link</a> <a href="">link</a> <a href="">link</a> </nav> </div>
you can use flexbox this, , use justify-content: space-around css property.
great intro flexbox here: http://flexboxin5.com/
Comments
Post a Comment