How do I increase horizontal space between my list? - html

I am trying to increase the space in my inline list so that they are not stuck side by side. I have tried word spacing and adding padding to the header a links, but that hasn't worked. Also, I found the only way to make my list in order (shop, products, faq, blog) inline and floating in the centre is to put the list backwards. So when I do blog faq products shop it will show up in the order as shop, products, faq blog. I was wondering if there was a way to be able to write them in html in order and still have them display inline in order. Any help is appreciated, thanks! BTW I have
* {
padding: 0px;
margin: 0px
}
already
#header-flex {
display: flex;
position: fixed;
background: rgb(0,191,255);
height: 75px;
width: 100%;
}
header a {
display: inline-block;
float: right;
}
header li a:hover {
color: orange;
cursor: grabbing;
}
nav p a:hover {
color: orange;
cursor: grabbing;
}
.left, .mid, .right {
float: left;
width: 33%;
}
<header>
<nav id="header-flex">
<div class="left">
<img src="logo.jpg" alt=logo width="30px" height="30px">
</div>
<div class="mid">
<ul>
<li >Blog</li>
<li >FAQ</li>
<li >Products</li>
<li >Shop</li>
</ul>
</div>
<div class="right">
<p>Sign In</p>
</div>
</nav>
</header>

Try below updated snippet code
#header-flex {
display: flex;
position: fixed;
background: rgb(0,191,255);
height: 75px;
width: 100%;
}
header a {
display: inline-block;
float: right;
}
header li a:hover {
color: orange;
cursor: grabbing;
}
nav p a:hover {
color: orange;
cursor: grabbing;
}
.left, .right {
float: left;
width: 25%;
}
.mid {
float: left;
width: 50%;
}
.mid ul{
padding: 0;
text-align: center;
}
.mid ul li{
display: inline;
list-style-type: none;
}
.mid ul li a{
float: none;
padding: 0 6px;
}
<header>
<nav id="header-flex">
<div class="left">
<img src="logo.jpg" alt=logo width="30px" height="30px">
</div>
<div class="mid">
<ul>
<li >Shop</li>
<li >Products</li>
<li >FAQ</li>
<li >Blog</li>
</ul>
</div>
<div class="right">
<p>Sign In</p>
</div>
</nav>
</header>

Why don't you write like this if you need another order?
<div class="mid">
<ul>
<li >Shop</li>
<li >Products</li>
<li >FAQ</li>
<li >Blog</li>
</ul>
</div>
or there is something I didn`t get
and for horizontal space do this
.mid li {padding: 0px, 10px,0px,10px;}

Related

How to postion text above images in HTML and CSS

I have a question in which I can't find answer or don't know how to search for answer.
I don't know how to position text above image in a way that I want them to align. The following image will clarify what I am asking.
Next is my HTML and CSS code, I only provided the HTML for about page, but CSS is for the whole website. This isn't anything professional, I am just trying to learn by doing. My idea is to use those images as links ( I know how to do that ). If there is similar question already asked, I apologize, I tried searching here and on YouTube, but could not find solution for this problem. If nothing I will edit pictures in GIMP with text in them.
body {
background: #e5fcf4;
font-family: Arial;
}
header {
text-align: center;
}
header nav {
display: inline-block;
}
header nav ul {
list-style: none;
margin: 0;
padding: 0;
}
header ul li {
float: left;
color: white;
width: 200px;
height: 40px;
background-color: #0d3801;
opacity: .9;
line-height: 40px;
text-align: center;
font-size: 20px;
}
header ul li a {
text-decoration: none;
color: white;
display: block;
}
header ul li a:hover {
background-color: green;
color: black;
}
header ul li ul li {
display: none;
}
header ul li:hover ul li {
display: block;
}
div.maincontent {
width: 70%;
padding: 2px;
margin: 2px;
float: left;
}
div.sidecontent {
width: 23%;
float: right;
padding: 2px;
margin: 2px;
margin-top: 10px;
}
div.maincontent img {
width: 900px;
height: 400px;
}
.clear {
clear: both;
}
footer {
background-color: #0d3801;
text-align: center;
}
footer img {
width: 200px;
height: 200px;
margin: 5px;
}
footer h2 {
font-size: 2rem;
color: white;
}
img.aboutimage {
width: 450px;
height: 400px;
float: left;
padding: 5px;
margin-left: 125px;
margin-top: 100px;
}
<header>
<nav>
<ul>
<li> Home </li>
<li> About
<ul>
<li><a> Our team </a></li>
<li><a> Camp sites </a></li>
<li><a> Mission & Vision </a></li>
</ul>
</li>
<li> Things to do
<ul>
<li><a> Activities </a></li>
<li><a> Parks </a></li>
<li><a> Coffee bars </a></li>
</ul>
</li>
<li> Contact
<ul>
<li><a> Map </a></li>
<li><a> Directions </a></li>
</ul>
</li>
<li> News </li>
</ul>
</nav>
</header>
<div>
<a href="">
<img class="aboutimage" src="https://images.pexels.com/photos/7097/people-coffee-tea-meeting.jpg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
<a href="">
<img class="aboutimage" src="https://images.pexels.com/photos/803226/pexels-photo-803226.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
<a href="">
<img class="aboutimage" src="https://images.pexels.com/photos/462353/pexels-photo-462353.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
</div>
wrap each image in div and before that add your text
<div >
<div style="width: 33%; float: left">
<h3>sample title</h3>
<a href="">
<img class="aboutimage">
</a>
</div>
...
</div>
Position your "a" depending on intended result. Now it only makes image to be link
Please check with this snippet
body {
background: #e5fcf4;
font-family: Arial;
}
header {
text-align: center;
}
header nav {
display: inline-block;
}
/* PRVI KORAK*/
header nav ul {
list-style: none;
margin: 0;
padding: 0;
}
/*DRUGI KORAK*/
header ul li {
float: left;
color: white;
width: 200px;
height: 40px;
background-color: #0d3801;
opacity: .9;
line-height: 40px;
text-align: center;
font-size: 20px;
}
/*TREĆI KORAK*/
header ul li a {
text-decoration: none;
color: white;
display: block;
}
/*ČETVRTI KORAK*/
header ul li a:hover {
background-color: green;
color: black;
}
/*PETI KORAK*/
header ul li ul li {
display: none;
}
header ul li:hover ul li {
display: block;
}
div.maincontent {
width: 70%;
padding: 2px;
margin: 2px;
float: left;
}
div.sidecontent {
width: 23%;
float: right;
padding: 2px;
margin: 2px;
margin-top: 10px;
}
div.maincontent img {
width: 900px;
height: 400px;
}
.clear {
clear: both;
}
footer {
background-color: #0d3801;
text-align: center;
}
footer img {
width: 200px;
height: 200px;
margin: 5px;
}
footer h2 {
font-size: 2rem;
color: white;
}
img.aboutimage {
width: 450px;
height: 400px;
float: left;
padding: 5px;
margin-left: 125px;
margin-top: 100px;
}
.img-block a{
position:relative;
}
.img-block a span{
position:absolute;
width:100%;
top:0;
left:0;
background:rgba(0,0,0,0.5);
padding:5px;
font-size:14px;
color:#fff;
font-weight:700;
text-align:center;
}
.img-block img{
padding:0;
width:100%;
margin:0;
height:auto;
}
.img-block a{
overflow:hidden;
float:left;
width:calc( 33.33% - 20px );
margin:0 10px;
}
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav>
<ul>
<li> Home </li>
<li> About
<ul>
<li><a> Our team </a></li>
<li><a> Camp sites </a></li>
<li><a> Mission & Vision </a></li>
</ul>
</li>
<li> Things to do
<ul>
<li><a> Activities </a></li>
<li><a> Parks </a></li>
<li><a> Coffee bars </a></li>
</ul>
</li>
<li> Contact
<ul>
<li><a> Map </a></li>
<li><a> Directions </a></li>
</ul>
</li>
<li> News </li>
</ul>
</nav>
</header>
<div class="img-block">
<a href="">
<span>Text1</span>
<img class="aboutimage" src="https://images.pexels.com/photos/7097/people-coffee-tea-meeting.jpg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
<a href="">
<span>Text2</span>
<img class="aboutimage" src="https://images.pexels.com/photos/803226/pexels-photo-803226.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
<a href="">
<span>Text3</span>
<img class="aboutimage" src="https://images.pexels.com/photos/462353/pexels-photo-462353.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</a>
</div>
</body>
</html>
You can use figure and figcaption to have text and an image aligned with each other.
I've used flex to make sure everything lines up how it should.
.imageblock {
display: flex;
justify-content: space-between;
}
.imageblock figure {
display: inline-flex;
flex-direction: column;
text-align: center;
width: 30vw;
margin: 0;
}
.imageblock figure * {
width: 100%;
}
<div class="imageblock">
<figure class="aboutimage">
<figcaption>How to add text here?</figcaption>
<img src="https://images.pexels.com/photos/7097/people-coffee-tea-meeting.jpg?w=1260&h=750&auto=compress&cs=tinysrgb">
</figure>
<figure class="aboutimage">
<figcaption>How to add text here?</figcaption>
<img src="https://images.pexels.com/photos/803226/pexels-photo-803226.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</figure>
<figure class="aboutimage">
<figcaption>How to add text here?</figcaption>
<img src="https://images.pexels.com/photos/462353/pexels-photo-462353.jpeg?w=1260&h=750&auto=compress&cs=tinysrgb">
</figure>
</div>
First you should wrap image with div and add following style for that div
Example:
<div style="width:33%; float:left">Sample Text</div>
Try this.

CSS & HTML: Menu-Bar <a> and <li> tags not in line

I'm trying to make a menu bar that is divided in three columns, where the left and the right side are links HOME and SEARCH, but in the center part of the menu there are several links nested inside a list. The columns are showing nicely, but for some mystical reason the HOME and SEARCH links are shown higher than the center content. I tried nesting the links HOME and SEARCH inside lists as well, but then everything in the menu-bar offsets to the right by a little bit and I would love it to be symmetrical without using padding or margins if possible.
It's probably something very simple and absolutely my fault, but here's me hoping.
So the question is how to either disable the offset to the right or how to make everything be on one line without using those in my opinion unnecessary <li>?
nav {
padding-left: 3em;
padding-right: 3em;
overflow: hidden;
}
nav div {
display: inline;
}
.area-center .menu li {
display: inline;
padding-right: 1em;
padding-left: 1em;
padding-top: none;
}
.menu ul {
list-style: none;
padding-left: 0;
}
.menu li {
list-style: none;
padding-left: 0;
}
.menu a {
text-decoration: none;
}
.area-right {
float: left;
width: 20%;
text-align: right;
}
.area-center {
float: left;
width: 60%;
text-align: center;
}
.area-left {
float: left;
width: 20%;
text-align: left;
}
<div id="menu_bar">
<nav id="main-menu" class="section">
<div class="area-left">
<a class="order">Home</a>
</div>
<div class="area-center">
<ul class="menu">
<li class="order"><a class="order">a</a></li>
<li class="order"><a class="order">b</a></li>
<li class="order"><a class="order">c</a></li>
<li class="order"><a class="order">d</a></li>
</ul>
</div>
<div class="area-right">
<a class="order">SEARCH</a>
</div>
</nav>
</div>
Browsers sets the default margin to <ul> elements if you didn't specify it. You can see this in below image
You have to set margin:0 to your <ul>
Stack Snippet
nav {
padding-left: 3em;
padding-right: 3em;
overflow: hidden;
}
nav div {
display: inline;
}
.area-center .menu li {
display: inline;
padding-right: 1em;
padding-left: 1em;
padding-top: none;
}
.menu ul {
list-style: none;
padding-left: 0;
}
.menu li {
list-style: none;
padding-left: 0;
}
.menu a {
text-decoration: none;
}
.area-right {
float: left;
width: 20%;
text-align: right;
}
.area-center {
float: left;
width: 60%;
text-align: center;
}
.area-left {
float: left;
width: 20%;
text-align: left;
}
ul {
margin: 0;
}
<div id="menu_bar">
<nav id="main-menu" class="section">
<div class="area-left">
<a class="order">Home</a>
</div>
<div class="area-center">
<ul class="menu">
<li class="order"><a class="order">a</a></li>
<li class="order"><a class="order">b</a></li>
<li class="order"><a class="order">c</a></li>
<li class="order"><a class="order">d</a></li>
</ul>
</div>
<div class="area-right">
<a class="order">SEARCH</a>
</div>
</nav>
</div>
You can fix it by adding line-height to area-left & area-right, maybe this isn't the best way, you can find better way
nav{
padding-left: 3em;
padding-right: 3em;
overflow:hidden;
}
nav div{
display:inline;
}
.area-center .menu li{
display:inline;
padding-right: 1em;
padding-left: 1em;
padding-top:none;
}
.menu ul{
list-style:none;
padding-left:0;
}
.menu li{
list-style:none;
padding-left:0;
}
.menu a{
text-decoration: none;
}
.area-right{
float: left;
width: 20%;
line-height:45px;
text-align: right;
}
.area-center{
float: left; width: 60%;
text-align: center;
}
.area-left{
float: left;
width: 20%;
line-height:45px;
text-align: left;
}
<div id="menu_bar">
<nav id="main-menu" class="section">
<div class="area-left">
<a class="order">Home</a>
</div>
<div class="area-center">
<ul class="menu">
<li class="order"><a class="order">a</a></li>
<li class="order"><a class="order">b</a></li>
<li class="order"><a class="order">c</a></li>
<li class="order"><a class="order">d</a></li>
</ul>
</div>
<div class="area-right">
<a class="order">SEARCH</a>
</div>
</nav>
</div>
There is an error in your CSS. .menu ul doesn't exist.
Update the selector to simply .menu, and also remove the default margin applied to the ul by the browser.
nav {
padding-left: 3em;
padding-right: 3em;
overflow: hidden;
}
nav div {
display: inline;
}
.area-center .menu li {
display: inline;
padding-right: 1em;
padding-left: 1em;
padding-top: none;
}
/* this is incorrect
.menu ul {
list-style: none;
padding-left: 0;
}*/
.menu {
margin: 0;
padding: 0;
}
.menu li {
list-style: none;
padding-left: 0;
}
.menu a {
text-decoration: none;
}
.area-right {
float: left;
width: 20%;
text-align: right;
}
.area-center {
float: left;
width: 60%;
text-align: center;
}
.area-left {
float: left;
width: 20%;
text-align: left;
}
<div id="menu_bar">
<nav id="main-menu" class="section">
<div class="area-left">
<a class="order">Home</a>
</div>
<div class="area-center">
<ul class="menu">
<li class="order"><a class="order">a</a></li>
<li class="order"><a class="order">b</a></li>
<li class="order"><a class="order">c</a></li>
<li class="order"><a class="order">d</a></li>
</ul>
</div>
<div class="area-right">
<a class="order">SEARCH</a>
</div>
</nav>
</div>

menu aligned with navbar

Can someone help me put my menu on the left next to my navbar.
As you can see the icon floats above the navigation which extends the top bar,
both the icon and navigation inside the top bar need to be aligned next to each other.
body{
margin: 0;
padding: 0;
}
#top-bar{
background-color: black;
padding: 1%;
width: auto;
}
#left-menu{
display: inline-block;
}
#navigation{
width: 100%;
text-align: center;
background-color: red;
}
#navigation ul{
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
position: relative;
display: inline-block;
overflow: hidden;
}
#navigation ul li{
float: left;
}
#navigation ul li a{
text-decoration: none;
margin-left: 5px;
}
<body>
<div id="top-bar">
<div id="left-menu">
<img src="icons/menu.png"/>
</div>
<div id="navigation">
<ul>
<li><a class="link" href="#"> Home </li>
<li><a class="link" href="#"> About Us </li>
<li><a class="link" href="#"> Contact </li>
</ul>
</div>
</div>
</body>
What you want to do is remove width: 100% from #navigation, and instead give it float: left.
You've also forgotten to close your <a> tags.
I've fixed this in the following:
body {
margin: 0;
padding: 0;
}
#top-bar {
background-color: black;
padding: 1%;
width: auto;
}
#left-menu {
display: inline-block;
}
#navigation {
/* width: 100%; */
float: left;
text-align: center;
background-color: red;
}
#navigation ul {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
position: relative;
display: inline-block;
overflow: hidden;
}
#navigation ul li {
float: left;
}
#navigation ul li a {
text-decoration: none;
margin-left: 5px;
}
<body>
<div id="top-bar">
<div id="left-menu">
<img src="http://placehold.it/100" />
</div>
<div id="navigation">
<ul>
<li><a class="link" href="#">Home</a></li>
<li><a class="link" href="#">About Us</a></li>
<li><a class="link" href="#">Contact</a></li>
</ul>
</div>
</div>
</body>
If you want to ensure that they're the same height, you're looking to give your #navigation a line-height property that equals the height of the image, along with display: block. This can be seen in the following:
body {
margin: 0;
padding: 0;
}
#top-bar {
background-color: black;
padding: 1%;
width: auto;
}
#left-menu {
display: inline-block;
}
#navigation {
/* width: 100%; */
float: left;
text-align: center;
background-color: red;
}
#navigation ul {
margin: 0;
padding: 0;
list-style-type: none;
text-align: center;
position: relative;
/* display: inline-block; */
display: block;
line-height: 100px; /* Equal to the height of the image */
overflow: hidden;
}
#navigation ul li {
float: left;
}
#navigation ul li a {
text-decoration: none;
margin-left: 5px;
}
<body>
<div id="top-bar">
<div id="left-menu">
<img src="http://placehold.it/100" />
</div>
<div id="navigation">
<ul>
<li><a class="link" href="#">Home</a></li>
<li><a class="link" href="#">About Us</a></li>
<li><a class="link" href="#">Contact</a></li>
</ul>
</div>
</div>
</body>
Hope this helps! :)

h1 and nav on the same line

I searched Stack overflow and google and tried all the suggestions to getting my h1 and nav on the same line. I tried inline, inline-block, setting the header itself to 100%. It's just not aligning. On top of that my li posted backwards when I set it to float left so the home that was on the top of the list is now on the outer end instead of the beginning. here's my code
.header{
background-color: #00001a;
height: 40px;
width: 100%;
}
ul{
list-style-type: none;
}
.header h1{
float: left;
color: #ffffff;
font-size: 15px;
display: inline-block;
}
.nav li{
float: right;
display: inline-block;
color: #ffffff;
}
<div class="header">
<div class="nav">
<h1>EaTogeter</h1>
<ul>
<li>home</li>
<li>About</li>
<li>Couples</li>
<li>family</li>
</ul>
</div>
</div>
<div class="Maincontent">
<div class="container">
<h2>Try It</h2
<p>Today's Try It Recipe!<p>
</div>
</div>
display: flex; justify-content: space-between; will put them on the same line and separate them with the available space.
.header {
background-color: #00001a;
padding: 0 1em;
}
.nav {
display: flex;
justify-content: space-between;
align-items: center;
}
ul {
list-style-type: none;
}
.header h1 {
color: #ffffff;
font-size: 15px;
}
.nav li {
color: #ffffff;
display: inline-block;
}
<div class="header">
<div class="nav">
<h1>EaTogeter</h1>
<ul>
<li>home</li>
<li>About</li>
<li>Couples</li>
<li>family</li>
</ul>
</div>
</div>
Put the heading and the navigation in their own containers. Float one left, the other right, and make sure to clear them afterwards.
header {
background-color: #00001a;
padding: 0px 10px;
box-sizing: border-box;
}
h1 {
color: white;
margin: 5px 0;
padding: 0;
}
.left {
float: left;
}
.right {
float: right;
}
.clear {
clear: both;
}
ul {
list-style-type: none;
}
ul li {
display: inline-block;
color: white;
margin-left: 20px;
}
<header>
<div class="left">
<h1>
EaTogether
</h1>
</div>
<div class="right">
<ul>
<li>Home</li>
<li>About</li>
<li>Couples</li>
<li>Family</li>
</ul>
</div>
<div class="clear"></div>
</header>
Note: I've changed "Togeter" to "Together", assuming it was a typo.
I am not sure if you want this thing but I just gave a try,
For this, set float:right to ul element and not on li elements.
Since you want to align h1 and li content set line-height to 0.5 for ul element
please check this fiddle: https://jsfiddle.net/hz0104mp/
<div class="header">
<div class="nav">
<h1>EaTogeter</h1>
<ul>
<li>home</li>
<li>About</li>
<li>Couples</li>
<li>family</li>
</ul>
</div>
</div>
<div class="Maincontent">
<div class="container">
<h2>Try It</h2>
<p>Today's Try It Recipe!<p>
</div>
</div>
.header{
background-color: #00001a;
height: 40px;
width: 100%;
}
ul{
list-style-type: none;
}
.header h1{
color: #ffffff;
font-size: 15px;
display: inline-block;
}
.nav ul{
float:right;
line-height:0.5;
}
.nav li{
display: inline-block;
color: #ffffff;
}
I like the flexbox method mentioned by #Michael Coker but here's a solution using floats as the OP attempted to do.
You were on the right track but might have been applying some of your CSS to the wrong elements for the wrong reasons.
On top of that my li posted backwards when I set it to float left so the home that was on the top of the list is now on the outer end instead of the beginning.
The reasons for this are not obvious until you break things down. The reason this happens is because float: right is applied to each element separately and in the order they appear in the markup, not as a whole. The browser will float Home as far to the right as it can. After that, it will move About as far to the right as it can. Rinse and repeat for any other li.
I rectified this by floating the ul instead of individual li and setting those to display: inline;. Floating the li to the left would also work.
header {
padding: 0 0.5rem;
height: 40px;
color: #ffffff;
background-color: #00001a;
}
ul,
li {
margin: 0;
padding: 0;
list-style: none;
}
header h1 {
margin: 0;
font-size: 15px;
display: inline-block;
}
header h1,
.nav li {
line-height: 40px;
}
.nav {
float: right;
}
.nav li {
padding: 0 0 0 0.25rem;
display: inline;
}
<header>
<h1>Eat Together</h1>
<ul class="nav">
<li>Home</li>
<li>About</li>
<li>Couples</li>
<li>Family</li>
</ul>
</header>
<main>
<h2>Try It</h2>
<p>Today's Try It Recipe!<p>
</main>
Please note that I took a few liberties with your markup to help provide an example of how it can be more semantic and achieved with less markup (along with a few choice styles to make it a little more "pretty").

How do I vertically center my navigation bar?

After searching extensively on Stack Overflow, I have not been able to answer what really should be a simple fix: How do I center my navigation bar?
Now, before you mark this as a duplicate, please regard my code and my question.
I am trying to make a navigation bar that looks something like this.
http://computersciencenow.weebly.com/
Where the links are the the middle of the overall bar.
Here is my Nav Bar HTML:
<div id = "navbar">
<header>
<div class="nav">
<ul>
<li id="img" width = "350"><img src="res/shahind.png" alt="Shah Industries" height = "150" width = "350" /></li>
<li class="home"><a class="active" href="#">HOME</a></li>
<li class="tutorials">ABOUT</li>
<li class="about">MISSION</li>
<li class="news">CONTACT</li>
</ul>
</div>
</header>
</div>
And here is the CSS
#import url(http://fonts.googleapis.com/css?family=Maven+Pro:400);
body {
margin: 0;
padding: 0;
background: #ccc;
}
.img{
text-align: left;
}
.nav ul {
list-style: none;
background-color: #444;
padding: 0;
margin: 0;
vertical-align: middle;
overflow: hidden;
}
.nav li {
font-family: 'Maven Pro', sans-serif;
font-size: 1.2em;
line-height: 40px;
height: 40px;
border-bottom: 1px solid #888;
text-align: center;
}
header{
vertical-align:center;
}
.nav a {
text-decoration: none;
color: #fff;
display: block;
transition: .3s background-color;
vertical-align: middle;
margin: 0;
}
.nav a:hover {
background-color: #005f5f;
}
.nav a.active {
background-color: #fff;
color: #444;
cursor: pointer;
}
#img{
width:350px;
text-align: left;
cursor: default;
}
#media screen and (min-width: 600px) {
.nav li {
width: 120px;
border-bottom: none;
height: 50px;
line-height: 50px;
font-size: 1.4em;
}
.nav li {
display: inline-block;
margin-right: -4px;
}
Full Code Is Here http://codepen.io/anon/pen/zGojxX
It can be as simple as it - vertical-align: middle;
Here is the simplified demo:
.nav {
list-style: none;
}
.nav li {
display: inline-block;
vertical-align: middle;
}
<div class="nav">
<ul>
<li><img src="//dummyimage.com/100x100" /></li>
<li class="home">HOME</li>
<li class="tutorials">ABOUT</li>
<li class="about">MISSION</li>
<li class="news">CONTACT</li>
</ul>
</div>
If you ever like the way another website works you can always right click and select 'view source' on it. If you do that on the website you want to copy you will see that the rest of the images are not in the list.
Here is the code the other person used. You will see that they have the images in a separate div
<div id='header'>
<div class='header-wrap'>
<div class='logo'>
<span class='wsite-logo'><a href='/'><img src='/uploads/3/9/2/2/39229753/1410676966.png' style='margin-top:1px;max-height:118px;' /></a></span>
</div>
<div class='menu'
<ul class='wsite-menu-default'><li id="active">Home</li><li id='pg551601871401491579'><a href="/our-mission.html" data-membership-required="0" >Our Mission</a></li><li id='pg551272351721461114'><a href="/private-lessons.html" data-membership-required="0" >Private Lessons</a></li><li id='pg661448056549841030'><a href="https://www.youtube.com/user/learnprogrammingCS" data-membership-required="0" target='_blank'>Youtube</a></li><li id='pg927757866254746423'><a href="/become-a-teacher.html" data-membership-required="0" >Become A Teacher</a></li><li id='pg206710261896176825'><a href="/boot-camp-for-dummies.html" data-membership-required="0" >Boot Camp for Dummies</a></li></ul>
</div>
</div>
</div>