I was playing around with the display:table/display:table-cell for nav menus and I've run into a problem. Essentially I am wanting each of the items to be spaced evenly across the given length of the UL.
I'm not sure what I'm missing but it seems to be giving the majority of the space to the first list element.
What am I missing?
HTML:
<div id="container">
<div id="fixedWidth">
<div id="logoAndLinks">
<div id="tapMatesLogo">
<p>Tapemates.</p>
</div>
<ul>
<li>Work</li>
<li>Story</li>
<li>Contact</li>
<li>Blog</li>
</ul>
</div><!-- logo and links -->
</div>
</div><!--end container -->
CSS:
*
{
margin: 0;
padding: 0;
}
#container
{
height: 1100px;
width: 100%;
display: block;
background: white;
border: 1px solid black;
}
#fixedWidth
{
height: 1100px;
width: 1100px;
display: block;
margin-top: 103px;
margin-left: auto;
margin-right: auto;
border: 1px solid #ccc;
}
#logoAndLinks
{
border: 1px solid black;
display: block;
width: 1060px;
height: 60px;
margin-left: 20px;
}
#tapMatesLogo
{
display: block;
float: left;
height: 56px;
width: 220px;
line-height:58px;
//border: 1px solid #ccc;
}
#tapMatesLogo p
{
color: #7933AE;
font-family: CenturyGothic, AppleGothic, sans-serif;
font-size: 43px;
}
ul
{
display: table;
//float: right;
list-style: none;
height: 32px;
width: 357px;
border: 1px solid black;
}
ul li
{
border: 1px solid black;
//float: left;
display: table-cell;
//padding-right:30px;
width: 100%;
font-size: 22px;
line-height: 30px;
font-family: CenturyGothic, AppleGothic, sans-serif;
}
Give the width of li 25%
*
{
margin: 0;
padding: 0;
}
#container
{
height: 1100px;
width: 100%;
display: block;
background: white;
border: 1px solid black;
}
#fixedWidth
{
height: 1100px;
width: 1100px;
display: block;
margin-top: 103px;
margin-left: auto;
margin-right: auto;
border: 1px solid #ccc;
}
#logoAndLinks
{
border: 1px solid black;
display: block;
width: 1060px;
height: 60px;
margin-left: 20px;
}
#tapMatesLogo
{
display: block;
float: left;
height: 56px;
width: 220px;
line-height:58px;
//border: 1px solid #ccc;
}
#tapMatesLogo p
{
color: #7933AE;
font-family: CenturyGothic, AppleGothic, sans-serif;
font-size: 43px;
}
ul
{
display: table;
//float: right;
list-style: none;
height: 32px;
width: 357px;
border: 1px solid black;
}
ul li
{
border: 1px solid black;
//float: left;
display: table-cell;
//padding-right:30px;
width: 25%;
font-size: 22px;
line-height: 30px;
font-family: CenturyGothic, AppleGothic, sans-serif;
}
<div id="container">
<div id="fixedWidth">
<div id="logoAndLinks">
<div id="tapMatesLogo">
<p>Tapemates.</p>
</div>
<ul>
<li>Work</li>
<li>Story</li>
<li>Contact</li>
<li>Blog</li>
</ul>
</div><!-- logo and links -->
</div>
</div><!--end container -->
Try adding table-layout: fixed to the ul element
https://jsfiddle.net/2ewov2qu/
Related
Hi, I need to know the exact width of the inner text in CSS. As you can see in the image, I want those menu items to have a proper width respectively, not including paddings or margins, so that I can give them a hover effect like "Posts" item. Is there any method I can use to get the width of the inner text?
/* Basic settings */
#import url('https://fonts.googleapis.com/css?family=Roboto:100,400,700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
transition: all .3s;
color: #333;
}
a {
text-decoration: none;
color: inherit;
}
li {
list-style-type: none;
}
img {
border: 0;
}
html, body {
height: 100%;
}
body {
font-family: "Roboto", Helvetica, sans-serif;
}
/* Main */
body {
background-color: whitesmoke;
}
header {
border-bottom: 1px solid #EEE;
height: 70px;
overflow: hidden;
background-color: white;
}
header > div {
vertical-align: middle;
}
header > #logo {
width: 15%;
padding: 20px;
border-right: 1px solid #EEE;
text-align: right;
display: inline-block;
}
header > #logo img {
width: 30px;
height: auto;
}
header > #search {
border-right: 1px solid #EEE;
width: 200px;
display: inline-block;
padding: 20px;
}
header > #search input {
border: 0;
outline: 0;
display: inline-block;
width: 80%;
vertical-align: middle;
padding-left: 10px;
}
header > #search a {
font-size: 1.2rem;
display: inline-block;
vertical-align: middle;
width: 20%;
}
header > #search > #search-box {
border: 1px solid #CCC;
border-radius: 100px;
overflow: hidden;
}
header > #gnb {
height: 70px;
display: inline-block;
vertical-align: middle;
border-right: 1px solid #EEE;
}
header > #gnb ul {
margin: 0 30px;
line-height: 70px;
}
header > #gnb li {
display: inline-block;
}
header > #gnb li:not(:last-child) {
margin-right: 20px;
}
header > #gnb a {
display: inline-block;
font-weight: lighter;
}
header > #gnb a:hover {
transform: translateY(-5px);
}
.premium {
color: orangered;
}
#social-media-icons {
display: inline-block;
vertical-align: middle;
border-right: 1px solid #EEE;
height: 70px;
}
#social-media-icons ul {
padding: 0 20px;
line-height: 70px;
}
#social-media-icons li {
display: inline-block;
}
#social-media-icons li:not(:last-child) {
margin-right: 15px;
}
#social-media-icons li a {
font-size: 2rem;
display: inline-block;
}
#social-media-icons li a:hover {
transform: translateY(-5px);
}
#profile {
display: inline-block;
vertical-align: middle;
}
#profile a {
margin-left: 20px;
}
#profile a img {
width: 50px;
height: 50px;
border-radius: 50%;
}
#sub-header {
border-bottom: 1px solid #EEE;
height: 50px;
background-color: white;
}
#sub-header ul {
width: 800px;
margin: 0 auto;
}
#sub-header li {
line-height: 47px;
display: inline-block;
border-bottom: 3px solid transparent;
padding: 0 20px;
}
#sub-header li:hover {
border-bottom: 3px solid cornflowerblue !important;
}
#sub-header a {
text-align: center;
display: inline-block;
width: 100%;
}
.selected {
border-bottom: 3px solid cornflowerblue !important;
}
main {
width: 1000px;
margin: 30px auto;
}
aside {
width: 200px;
background-color: white;
}
#bill-gates {
padding: 20px;
border-bottom: 1px solid #EEE;
}
#bill-gates-image {
margin-bottom: 20px;
}
#bill-gates-image > img {
margin: 0 auto;
display: block;
width: 100px;
height: 100px;
border-radius: 50%;
}
#bill-gates-bio {
text-align: center;
margin-bottom: 30px;
}
#bill-gates-bio > h2 {
margin-bottom: 5px;
}
#bill-gates-bio > p {
font-weight: lighter;
margin-bottom: 3px;
}
#bill-gates-bio > p:last-child {
color: #CCC;
}
#bill-gates-follow-button {
text-align: center;
margin-bottom: 10px;
}
#bill-gates-follow-button > a {
display: inline-block;
line-height: 20px;
padding: 10px 50px;
background-color: cornflowerblue;
color: white;
border-radius: 30px;
border: 1px solid transparent;
}
#bill-gates-follow-button > a:hover {
background-color: rgb(70, 134, 253);
}
#bill-gates-connect-button {
text-align: center;
}
#bill-gates-connect-button > a {
line-height: 20px;
display: inline-block;
padding: 10px 40px;
background-color: white;
color: cornflowerblue;
border: 1px solid cornflowerblue;
border-radius: 30px;
}
#bill-gates-connect-button > a:hover {
background-color: #EEE;
}
#aside-middle {
overflow: hidden;
border-bottom: 1px solid #EEE;
height: 80px;
}
#connections {
text-align: center;
float: left;
width: 50%;
height: 100%;
border-right: 1px solid #EEE;
}
#followers {
text-align: center;
float: right;
width: 50%;
height: 100%;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="style.css" type="text/css">
<title>Bill Gates</title>
</head>
<body>
<header>
<div id="logo">
<a href="#">
<img src="./img/logo.png" alt="LinkedIn logo">
</a>
</div><!--
--><div id="search">
<div id="search-box">
<input type="search" name="search" placeholder="Search"><!--
-->🔍
</div>
</div><!--
--><div id="gnb">
<ul>
<li>
Home
</li>
<li>
Profile
</li>
<li>
Connections
</li>
<li>
Interest
</li>
<li class="premium">
Try Premium
</li>
</ul>
</div><!--
--><div id="social-media-icons">
<ul>
<li>
đź—Ł
</li>
<li>
đź””
</li>
<li>
âž•
</li>
</ul>
</div><!--
--><div id="profile">
<a href="#">
<img src="./img/avatar.jpg" alt="Profile image">
</a>
</div>
</header>
<div id="sub-header">
<ul>
<li class="selected">
Posts
</li><li>
Background
</li><li>
Recommendations
</li><li>
Following
</li>
</ul>
</div>
<main>
<aside>
<div id="bill-gates">
<div id="bill-gates-image">
<img src="./img/bill-gates-avatar.png" alt="Bill Gates Profile image">
</div>
<div id="bill-gates-bio">
<h2>Bill Gates</h2>
<p>Microsoft Founder</p>
<p>Greater Seattle Area</p>
</div>
<div id="bill-gates-follow-button">
Follow
</div>
<div id="bill-gates-connect-button">
Connect ↓
</div>
</div>
<div id="aside-middle">
<div id="connections">
<h3>200</h3>
<p>connections</p>
</div>
<div id="followers">
<h3>1.9M</h3>
<p>followers</p>
</div>
</div>
</aside>
</main>
</body>
</html>
Use the width property of an element, which gets the width of the content area excluding any paddings, borders or margins.
.bg-tag {
font-family: Arial, sans-serif;
font-size: 14px;
text-decoration: none;
}
.bg-tag:focus {
padding-bottom: 2px;
border-bottom: 2px solid #000; #change colour as you like
width: 100%;
}
Background
I am working on web page layouts. I created this one.
https://codepen.io/iamgonge/pen/paOxxb
I dont understand why the .container .left-side and .right-side elements start at the top of the browser and not below the header. Shouldn't the layout out be header->section(hero)->section(one)? I would think that the top of any of those three divs would be underneath the header but they are not. What amy I not understanding here?
body {
font-family: Verdana, Geneva, sans-serif;
margin: 0;
padding: 0;
}
.container {
background: #333338;
display: inline-block;
width: 60%;
height: 800px;
}
header {
position: fixed;
background: #10105f;
width: 100%;
height: 150px;
}
.main-links a {
text-decoration: none;
color: #fff;
font-size: 20px;
text-transform: uppercase;
}
.main-links a:hover {
color: #00843d;
}
.main-links a:active {
color: red;
}
.left-side {
display: inline-block;
width: 20%;
background: #4C4C59;
height: 800px;
float: left;
}
nav {
position: absolute;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
text-align: center;
}
nav ul {
margin: auto;
padding: 0;
display: inline-block;
list-style: none;
color: #fff;
// border: 1px solid #00843D;
width: 60%;
;
}
nav li {
display: inline-block;
margin: 5px -3px;
padding: 5px 10px;
// border: 1px solid#fff;
}
nav li:hover {
background: rgba(255, 255, 255, 0.25);
}
nav li:active {
border-bottom: 2px solid red;
color: red;
}
.nav-left {
float: left;
height: 50px;
width: 20%;
padding-bottom: 96px;
// border: 1px solid #00843D;
}
.nav-right {
float: right;
height: 50px;
width: 20%;
padding-bottom: 96px;
//border: 1px solid #00843D;
}
.nav-center {
position: relative;
padding-bottom: 21px;
margin: 0 auto;
height: 75px;
width: 300px;
// border: 1px solid #00843D;
}
.nav-right p a {
font-size: 16px;
text-decoration: none;
color: #fff;
}
.nav-right p a:hover {
color: #00843d;
}
.nav-right p {
margin: 20px;
padding: 0;
color: #fff;
}
.one {
display: block;
width: 100%;
height: 800px;
background: #080853;
}
.right-side {
display: inline-block;
width: 20%;
background: #4C4C59;
height: 800px;
float: right;
}
.rss-title,
.rss-date {
margin: 0px!important;
}
.rss-feed {
margin: 10px 5px 20px 0px;
}
.rss-date {
padding: 0;
font-size: 12px;
font-style: italic;
}
.hero,
.one {
position: relative;
height: 100%;
}
.success {
display: block;
text-align: center;
margin-top: 20%;
font-size: 69px;
color: #00843d;
// margin-left: auto;
// margin-right: auto;
}
.success:hover {
font-size: 71px;
}
#timestamp {
margin: 10px 5px 20px 0px;
text-align: center;
color: #fff;
font-size: 16px;
}
#timestamp,
.rss-feed {
background: #080853;
padding: 10px;
height: 110px;
}
#media (min-width:1530px) {}
<body>
<header>
<div class="nav-left">
<div id="timestamp"></div>
</div>
<div class="nav-right"></div>
<div class="nav-center"></div>
<nav>
<ul class="main-nav">
<li class="main-links">home</li>
<li class="main-links">about</li>
<li class="main-links">projects</li>
<li class="main-links">portal</li>
<li class="main-links">links</li>
</ul>
</nav>
</header>
<section="hero">
<div class="left-side"></div>
<div class="right-side"></div>
<div class="container">
<div class="success"></div>
</div>
<!--***Container***-->
</section>
<section class="one"></section>
</body>
The reason is that you have applied position: fixed; to your <header> tag. When you do this you must account for the height of the header and push down other elements to restore the layout.
I have been working on a grid system for a practice website for about two weeks now and I still can't figure it out. I have been watching youtube videos and reading articles left and right with no luck. This is what I have come up with thus far:
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #2A2A2A;
border-top: 1px solid black;
border-bottom: 1px solid black;
}
li {
float: right;
text-color: white;
border-left: 1px solid white;
font-family: "Comic Sans MS";
}
li:hover {
background-color: #1D1D1D;
}
li a {
display: block;
padding: 8px;
color: white;
margin: 7px 5px 7px 5px;
}
li a:hover {
background-color: #1D1D1D;
color: white;
text-decoration: none;
}
li:first-child {
background-color: #00E006;
border: none
}
li:first-child:hover {
background-color: #05aa0a;
}
li:first-child a:hover {
background-color: #05aa0a;
}
.fit {
max-width: 100%;
max-height: 100%;
}
.background {
background-color: grey;
}
p {
color: black;
font-family: "Trebuchet MS";
font-size: 16px;
margin: 10px;
}
a:hover {
text-decoration: none;
}
.bigger-text {
font-size: 20px;
}
.profile-img-border {
border: 1px solid black;
border-radius: 50%;
}
.img-border {
border: 3px solid black;
border-radius: 100%;
margin: 5px
}
div.img {
margin: 0 auto;
border: 1px solid #ccc;
float: left;
width: 280px;
display: block;
}
div.img:hover {
border: 1px solid #777;
}
div.img img {
width: 100%;
height: auto;
}
div.desc {
padding: 15px;
text-align: center;
background-color: white;
}
.container {
width: 1460px;
margin-right: auto;
margin-left:auto
}
five:first-child, four:first-child, three:first-child, two:first-child, one:first-child, six:first-child {
margin-left: 0;
}
.six {
width: 100%;
display: block;
}
.five {
width: 80%;
display: block;
float: left;
margin-left: 2%;
}
.four {
width: 66%;
display: block;
float: left;
margin-left: 2%;
}
.three {
width: 49%;
display: block;
float: left;
margin-left: 2%;
}
.two {
width: 32%;
display: block;
float: left;
margin-left: 2%;
}
.one {
width: 15%;
display: block;
float: left;
margin-left: 2%;
}
.row {
width: 100%;
clear: both;
padding: 0px;
margin: 0px;
}
<!DOCTYPE html>
<html>
<head>
<Title>Personal Portfolio FCC</Title>
<link rel="stylesheet" href="Hello%20World.css">
</head>
<body class="background">
<div class="container">
<div class="row">
<div class="top-bar-box align-middle-v" align="right">
<ul>
<li style="float:left">
<a class="active">Home</a>
</li>
<li><a>About</a></li>
<li><a>Portfolio</a></li>
<li><a>Contact</a></li>
</ul>
</div>
</div><!--Row 1 closer-->
<div class="row"><!--Row 2 opener-->
<div class="four">
<p>"text text text"</p>
</div>
<div class="two">
<img src="#" alt="A picture of a verry handsome
fellow(me)" class="profile-img-border"></img>
</div>
</div><!--Row 2 closer-->
</div>
</body>
</html>
you could start by moving this to the end
five:first-child,
four:first-child,
three:first-child,
two:first-child,
one:first-child,
six:first-child {
margin-left: 0;
}
and replacing it with
.five:first-child,
.four:first-child,
.three:first-child,
.two:first-child,
.one:first-child,
.six:first-child {
margin-left: 0;
}
I'm learning HTML and I've made a program I need help for. I have written all the code but I want the pictures BOB 1/2/3 to be next to each other. Futhermore I don't know why I can't see the "Home". Also want that the the information at the buttom of the page should be next to each other
Thanks in advance :)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>My first website</title>
<meta name="viewport" content="width=divice-width, initial-scale=1.0">
<style>
body{
background: #00FF33;
font-family: Verdana, Tahama, Arial, sans-serif;
font-size: 18px;
overflow: auto;
}
h1, h2, h3 {
text-align: center;
padding-left: 5%;
color: #000066;
}
p {
padding: 2%
color: #000066;
}
img {
text-align: center;
max-width: 100%;
height: auto;
width: auto;
}
#wrapper {
margin: 0 auto;
max-width: 1020px;
width: 98%
background: #000000;
border: 1px solid #878E63;
border-radius: 2px;
box-shadow: 0 0 10px 0px rgba(12, 3 , 25, 0.8);
}
#callout {
width: 100%;
height: auto;
background: #000000;
overflow: hidden;
}
#callout p{
text-align: right;
font-size: 13px;
padding: 0.1% 5% 0 0;
color: #FFFF00;
}
#callout p a{
color: #CC0000;
text-decoration: none;
}
header {
width: 96%;
min-height: 125px;
padding: 5px;
text-align: center;
}
nav ul {
list-style: none;
margin: 0;
padding-left: 50px;
}
nav ul li {
float: left;
border: 1px solid #878E63;
width: 15%;
}
nav ul li a {
background: #F1F0D1;
display: black;
padding: 5% 12%
font-weight: bold;
font-size: 18px;
color: #878E63;
text-decoration:none;
text-align: center;
}
nav ul li:hover, nav ul li.active a {
background-color: #878E63;
color: #878E63;
}
.banner img {
width: 100%;
border-top: 1px solid: #878E63;
border-bottom: 1px solid: #878E63;
}
.clearfix {
clear: both;
}
.BobContainer{
width: 29%;
display: inline-block;
text-align: center;
margin: 0 1.666%;
}
.left-col {
width: 55%;
margin: -2% 1% 1%;
float: left;
}
.sidebar {
width: 40%;
float: right;
margin: 1%;
text-align: center;
}
.hallo{
float: left;
margin: 0 auto;
width: 100%;
height: auto;
padding: 1%;
}
.section{
width: 29%;
margin: 2% 2%;
display: inline-block;
text-align: center;
}
footer{
background: #878E63;
width: 100%;
overflow: hidden;
}
footer p, footer h3{
color: #F1F0D1;
}
footer p a{
color: #F1F0D1;
text-decoration: none;
}
ul{
list-style-type: none;
margin: 0;
padding: 0;
}
li {
display: inline;
}
ul li img{
height: 50%;
}
.footerLogos{
width: 45%;
margin: 0 2.45%;
display: inline-block;
text-align: center;
}
/*---------MEDIA---------*/
#media screen and (max-width: 478px){
body{
font-size: 13px;
}
}
#media screen and (max-width: 740px){
nav{
width: 100%;
margin-bottom: 10px;
}
nav ul{
list-style: none;
margin: 0 auto;
padding-left: 0;
}
nav ul li{
text-align: center;
margin-left: 0 auto;
width: 100%;
border-top: 1px solid #878E63;
border-left: 0px solid #878E63;
border-bottom: 1px solid #878E63;
border-right: 0px solid #878E63;
}
nav ul li a{
padding: 8px 0;
font-size: 16px;
}
.left-col {
width: 100%;
}
.sidebar{
width: 100%;
}
.section{
float: left;
width: 100%;
margin: 0;
}
}
</style>
</head>
<body>
<div id="wrapper">
<div id="callout">
<p>Call us at <b>123456</b></p>
</div>
<header>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"
</header>
<nav>
<ul>
<li class='active'>Home</li>
<li>Prices</li>
<li>Who are we?</li>
</ul>
</nav>
<div class="banner">
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
</div>
<section class="left-col">
<p style ="text-indent: 50px;">Restaurant websites are a great place to find inspiring designs and also to check out some nice ways of displaying photographs within a design. Since the main content of a restaurant is their food – or at least it should be – there is no better thing to do than show beautiful images of the food</p>
<p style ="text-indent: 50px;">HELLOZZ</p>
</section>
<aside class="sidebar">
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<div class="hallo">
</div>
</aside>
<div class="BobContainer">
<h3>BOB1</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Du</p>
</div>
<div class="BobContainer">
<h3>BOB2</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Er</p>
</div>
<div class="BobContainer">
<h3>BOB3</h3>
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
<p>Dum</p>
</div>
<footer>
<div class="footerLogos"
<p>Call us at:</p>
<p><b>123456</b><br>
Or write to<br>
www#hotmail.com<br>
2670 Greve</p>
</div>
<div class="footerLogos"
<ul>
<li><img src="http://www.adweek.com/socialtimes/wp-content/uploads/sites/2/2013/04/2-150x150.png"</li>
<li><img src="http://virtualmarketingpro.com/blog/empreendeglobal/wp-content/uploads/sites/897/2015/01/logo-youtube-335x320.png"</li>
</ul>
<div class="footerLogos"
<img src="http://www.logodesignbuzz.com/creativelogos/wp-content/uploads/2010/07/alnabulsi-creative-logos.jpg"</a>
</div>
</footer>
</div>
<p style="text-align: center; padding:0px;">©Copyright - hala hala, 2015</p>
</body>
</html>
In CSS Code Try Adding To Section Styles : display: inline-block;
Also Delete : float : left;
I have a slight problem with my code trying to get on the navbar, each section to have an equal amount of space and not have space according to how many characters they have in the title. For example, MAP should have as much as ABOUT.
Here is what it looks like now:
.wrap {
width: 90%;
background-image: url(images/navbarbackground.png);
background-repeat: no-repeat;
margin: auto;
box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3);
padding: 0px;
font-family: minecrafter;
}
.wrap:after {
content: " ";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.wrap ul {
display: table;
width: 95%;
}
.wrap li {
display: table-cell;
vertical-align: middle;
}
.wrap li a {
text-decoration: none;
background-color: #EEEEEE;
color: #666666;
padding: 6px 0 6px 0;
border: 1px solid #CCC;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
display: block;
text-align: center;
}
.wrap h2 {
margin-top: 10px;
margin-bottom: 10px;
text-transform: uppercase;
color: #ffffff;
width: 6em;
text-align: center;
line-height: 1.0;
letter-spacing: .04em;
display: in line-block;
vertical-align: middle;
float: left;
}
.wrap h2 span {
display: block;
letter-spacing: .17em;
}
.navwrap {
margin-top: 0px;
overflow: hidden;
padding-top: 16px;
padding-bottom: 0px;
margin-bottom: 10px;
}
<div class="wrap">
<h2 class="minecrafter">Miners <span>Union</span></h2>
<div class="navwrap">
<ul class="nav">
<li>Home
</li>
<li>Forums
</li>
<li>Donate
</li>
<li>Apply
</li>
<li>Map
</li>
</ul>
</div>
</div>
You could try this: fiddle
.wrap ul {
width:100%;
padding: 0;
}
.wrap li {
display:inline-block;
float: left;
width: 20%;
vertical-align:middle;
}
You just need
.wrap ul {
table-layout:fixed; /* this */
}
.wrap {
width: 90%;
background-image: url(images/navbarbackground.png);
background-repeat: no-repeat;
margin: auto;
box-shadow: 5px 5px 20px rgba(0, 0, 0, 0.3);
padding: 0px;
font-family: minecrafter;
}
.wrap:after {
content: " ";
clear: both;
display: block;
height: 0;
visibility: hidden;
}
.wrap ul {
display: table;
width: 80%; /* adjusted for demo only */
table-layout:fixed;
}
.wrap li {
display: table-cell;
vertical-align: middle;
}
.wrap li a {
text-decoration: none;
background-color: #EEEEEE;
color: #666666;
padding: 6px 0 6px 0;
border: 1px solid #CCC;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
display: block;
text-align: center;
}
.wrap h2 {
margin-top: 10px;
margin-bottom: 10px;
text-transform: uppercase;
color: #ffffff;
width: 6em;
text-align: center;
line-height: 1.0;
letter-spacing: .04em;
display: in line-block;
vertical-align: middle;
float: left;
}
.wrap h2 span {
display: block;
letter-spacing: .17em;
}
.navwrap {
margin-top: 0px;
overflow: hidden;
padding-top: 16px;
padding-bottom: 0px;
margin-bottom: 10px;
}
<div class="wrap">
<h2 class="minecrafter">Miners <span>Union</span></h2>
<div class="navwrap">
<ul class="nav">
<li>Home
</li>
<li>Forums
</li>
<li>Donate
</li>
<li>Apply
</li>
<li>Map
</li>
</ul>
</div>
</div>
Or look this way
.nav{
list-style: none;
}
.nav li{
display: inline-block;
min-width: 100px;
}
.nav li a{
text-decoration: none;
background-color: #EEEEEE;
color: #666666;
padding: 6px;
border: 1px solid #CCC;
border-right: 1px solid #333;
border-bottom: 1px solid #333;
display: block;
text-align: center;
}