I need a navigator on the right side of this header.

Mastah

the funny thing is \r\n i did
Oct 25, 2010
739
41
So I wanted to have a header with a navigator bar as well as a logo but they need to align together.

Here's a little example.
4cf81f208f3f4bc2a595073502cef47a.png


Here's all the code I haz.

HTML:
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta itemprop="image" content="/images/192x192.png">
        <meta name="mobile-web-app-capable" content="yes">
        <meta name="robots" content="index,follow"/>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title> Lel: Home </title>
      
        <!--- De website icoon niet kopieren alstublieft! --->
        <link rel="shortcut icon" href="/images/icon.ico">
      
        <!--- Al de stylesheets kunt u hier vinden --->
        <link rel="stylesheet" type="text/css" media="all" href="/css/global.css" />
    </head>
  
    <body>
      
        <div id="header">
            <div id="header_logo">
                Fucken Logo m8
            </div>
          
    
      
        </div>
      
      
        <!--- Einde van header --->
      
    </body>
</html>


Here's the css

Code:
/* Tabel van content
- Body
- Header
- Logo
- Navigator
*/



body {
   margin: 0 auto;
   background-color: #F5F5F5;
   font-family: Arial;
}

#header {
    background-color :#77A6B5;
    width: 100%;
    height: 45px;
    top: 0;
    z-index: 500;
    position: fixed;
    border-bottom: 1px solid #5E838F;
}

#header_logo {
    position: relative;
    padding: 15px 0px 15px 5px;
    float: right;
    width: calc(100% - 56px);
    color: #fff;
}


Whoever is able to do this for me thank you in advance you're great!
 

RastaLulz

fight teh power
Staff member
May 3, 2010
3,935
3,936
There's many ways to accomplish this, I guess it all comes down to what type of browser support you want.
  1. You could use flexbox, although it's still being ironed out in terms of support, and different browsers may act differently with it.
  2. You could use floats.
  3. You could use a table (basically flexbox, but more ghetto, and compatible with all* browsers).
Here are examples using all the methods mentioned above:
 

Users who are viewing this thread

Top