How to set where the page starts

Discussion in 'PHP' started by mberman84, Nov 5, 2008.

  1. #1
    basically what i want to do is add a navigation bar to the top 27 pixels of my website. the nav bar is called with a JS function and works all by itself.

    however, sometimes when i add it to certains sites..the CSS of the site will mess with the nav bar css.

    what i want to do is display the nav bar in the top 27 pixels...and then start the rest of the site directly below those 27 pixels. i dont want the nav bar to interact with the site in any way.

    how do i do this?
     
    mberman84, Nov 5, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
  3. Bind

    Bind Peon

    Messages:
    70
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    something like this may work, but its hard to tell as you didnt post any code.

    
    <div id="menubar" style="height:27px;clear:both;text-align:center;">
         <!-- menu script here -->
    </div>
    
    Code (markup):
     
    Bind, Nov 5, 2008 IP
  4. JEET

    JEET Notable Member

    Messages:
    3,832
    Likes Received:
    502
    Best Answers:
    19
    Trophy Points:
    265
    #4
    Try this:

    <body style=" margin: 50px 5px 5px 5px;">
    <div id="menu" style="position: absolute; top: 27px; height: 20px; left: 6px;">
    Menu code
    </div>

    If you want menu height to be more, just increase 50px in body margin as well otherwise it'll overlap.

    Try this:

    <body style=" margin: 60px 5px 5px 5px;">
    <div id="menu" style="position: absolute; top: 27px; height: 30px; left: 6px;">
    Menu code
    </div>
    regards :)
     
    JEET, Nov 5, 2008 IP
  5. mberman84

    mberman84 Peon

    Messages:
    511
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    thanks for this. i tried it and it still doesnt really work well. the site i am trying to install the bar on is barackobamajokes.com

    here is the code for the bar surrounded by the code you gave me:

    <body style=" margin: 27px 0px 0px 0px;">
    <div id="menu" style="position: absolute; top: 27px; height: 20px; left: 6px;">
    <script language="javascript" type="text/javascript">
    <!--
           var nlSiteName = 'Barack Obama Jokes';
           var nlSiteURL = 'http://www.NationalLampoon.com';
           var nlWidth = '100%'; //set by %(percentage) or px(pixels)
           var nlMarginLeft = '0px'; //set by px(pixels) only
           var nlMarginRight = '0px'; //set by px(pixels) only
           var nlVertical = 'humor';
           var nlTextColor = 'FFFFFF'; //color of text in bar
    -->
    </script>
    <script src="http://www.nationallampoon.com/nlhat/nlbar.js" type="text/javascript"></script>
    </div>
    
    Code (markup):
    I put this directly before the <body> tag. I left the bar up (not working properly) so you can see what i mean.

    thanks!


    PS.... the bar should look like it does on nationallampoon.com :)
     
    mberman84, Nov 6, 2008 IP