Fix Bar

Discussion in 'HTML & Website Design' started by Syed Haider, May 4, 2013.

  1. #1
    Hi All

    How Can I Get A Bar Like This Fixed In As Top Bar???

    [​IMG]

    Thanks In Advance :)
     
    Syed Haider, May 4, 2013 IP
  2. weblinsolutions

    weblinsolutions Well-Known Member

    Messages:
    29
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    118
    #2
    You can use a Web Toolbar like HelloBar.
     
    weblinsolutions, May 4, 2013 IP
  3. cadsii

    cadsii Well-Known Member

    Messages:
    220
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #3
    or you can code it yourself,

    I would set it as a fixed position so it's always up there when you scroll the page

    like this


    <div class="topnav">
    <a href="">Link 1</a>
    <a href="">Link 2</a>
    <a href="">Link 3</a>
    </div>

    <div class="body">
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    Content can go here<br/><br/>
    </div>


    css


    .topnav {
    position: fixed;
    top:0;
    width:100%;
    height:20px;
    background:red;
    }

    .body {
    margin-top:20px;
    }
     
    cadsii, May 8, 2013 IP
  4. cadsii

    cadsii Well-Known Member

    Messages:
    220
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    110
    #4
    http://jsfiddle.net/cadsii/rP2PN/

    here is the live working version
     
    cadsii, May 8, 2013 IP
  5. creativewebmaster

    creativewebmaster Active Member

    Messages:
    654
    Likes Received:
    7
    Best Answers:
    4
    Trophy Points:
    78
    #5
    May this help you:

    bar{
    width:100%;
    height:200px;
    background:#000;
    position: fixed;
    top:0;
    left:0;
    <div id="bar">content inside bar goes here</div>
     
    creativewebmaster, May 8, 2013 IP