1

I want something like this:

+-------------------------------------------------------------------+
|                                                                   |
| LOGO                           Search_box... ITEM_1 ITEM_2 ITEM_3 |
|                                                                   |
+-------------------------------------------------------------------+

The LOGO is an image. Search_box is an input text and ITEM_X an orizontally list item.

I tried this, but the logo doesn't stay where I want: https://jsfiddle.net/mna4de2n/

Note: I did not implement the input text yet.

CSS:

header{
    width: 100%;
    height: auto;
    text-align: center;
    display: inline-block;
}

header ul {
    list-style-type: none;
    text-align: center;
    padding: 0.5vw;
    overflow: hidden;
}

header li {
   display: inline;
}

header li a{
    display: inline-block;
    color: #262626;
    text-align: center;
    padding: 0.5vh 0.5vw;
    text-decoration: none;
}

header .left {
    padding-left: 15%;
    float: left;
}

header .right {
    float: right;
    padding-right: 25%;
}

header img {
  width: 10%;
}

HTML:

<header>
    <div class="left">
      <li><img src="http://logok.org/wp-content/uploads/2017/05/YouTube-logo-2017-logotype.png"></li>
    </div>
    <div class="right">
      <ul>
        <li><a class="active" href="#home">Matcha</a></li>
        <li><a href="#news">News</a></li>
        <li><a href="#contact">Contact</a></li>
        <li><a href="#about">About</a></li>
        </ul>
    </div>
</header>
disinfor
  • 10,865
  • 2
  • 33
  • 44
Alex
  • 139
  • 3
  • 10
  • Because `li` stands for `list item`. `li` should go inside `ol` or `ul`. [See this](https://www.w3schools.com/TagS/tag_li.asp). – Vanity Slug - codidact.com Sep 29 '17 at 18:09
  • because li is a sub element of ul or ol you need them. – Danimal Sep 29 '17 at 18:10
  • 3
    It's great that you have a jsfiddle but you also add the code in a code block/snippet in the question itself since the fiddle could break at some point. – Lexi Sep 29 '17 at 18:10
  • 1
    There is a typo in the CSS change that you made, @alex. See the .left class. It says "disaply" instead of "display." Display should just be removed since it has no effect here. – Trioj Sep 29 '17 at 18:15
  • @alex, thank you. But, what about vertically align of the logo? – Alex Sep 29 '17 at 18:17
  • Yeah, thank you @Trioj. [Here is new link](https://jsfiddle.net/mna4de2n/9/). – Vanity Slug - codidact.com Sep 29 '17 at 18:18
  • @Alex to vertically align [read this](https://stackoverflow.com/questions/7273338/how-to-vertically-align-an-image-inside-a-div). – Vanity Slug - codidact.com Sep 29 '17 at 18:19