Jacob, I'm sorry --- you have the right idea about the include call, but you
are using it all wrong.
The correct way of doing this would be to just have the links by themselves
in the navbar.php -- no HTML tag, HEAD tag, CSS, etc
navbar.php:
<div id="navigation">
<a>Link one</a>
<a>Link two</a>
<a>Link three</a>
</div>
Then, in every php file that you need the navigation, you need to place add
the include call:
<?php
include("navbar.php");
?>
Make sure you add the include call in the exact location you want the <div
id="navigation"> to show up.
-Richard Aday
On Tue, Feb 10, 2009 at 3:12 PM, eLusive <[email protected]> wrote:
>
> Personally, I use PHP to include my navagational bars. In your case,
> the CSS-positioned navagational bar will be extremely easy to do.
>
> Assuming you know nothing (i'm sure this is not the case, but it'll
> help others..)
>
> First, get your navbars code, for learning sake, it's just going to be
> <div>LINK</div>
>
> Copy/paste that to a new file, and save it as navbar.php in your root
> directory.
> In navbar.php, you should have <div>LINK</div>
> Now alter it, so that the code is inbetween <body> tags, and add the
> <html> and <head> tags to allow for CSS coding. You could do this in
> the style attribute of the div tag, however that is very messy and I'm
> a freak when it comes to organizing my code.
>
> Your file should now look like this...
>
> <html>
>
> <head>
>
> <style>
> div.snavbar
> {
> position:fixed;
> left/right:0px;
> }
> </style>
>
> </head>
>
> <body>
> <div class="snavbar">LINK</div>
> </body>
>
> </html>
>
> Breaking down that code, you'll see in the style that I've fixed the
> position, meaning that the box will stay in the same position in the
> browser, not matter where you scroll. If you don't want it to behave
> like that (though I'm assuming you do..), try absolute or relative,
> I'm not 100% sure and can't test it.
>
> The left/right should only be left:0px; or right:0px;
> This will position the div tag on the absolute border of the webpage.
> Adjust this accordingly, you can also use a percentage so that the
> distance between the window side and the div tag is altered according
> to the width/height of the browser.
>
> Also note i added a class to the div tag, "Class="snavbar"", this will
> style the div tag in accordance with div.snavbar (which will only work
> for a div due to the div. part).
>
> Now, say you are editting your index.html, you are going to need to
> rename it to index.php
> Where your navagational bars code was (the <div>link</div>), replace
> it with the code...
>
> <?php
> include(/navbar.php);
> ?>
>
> I think that works.. again I dont really have a way of testing at the
> moment, I'm sorry. You may need to edit it like...
>
> <?php
> include("/navbar.php");
> ?>
>
> but the alterations wont be different, just look at includes on
> w3schools.com (best site to learn from, they just had a restyle
> too :D)
>
> Now, load your page on a php-enabled server, and it should be fine.
> My home computer is asleep, so my personal webserver isn't up now and
> i can't access my webserver at school (using ports in the URL are
> disables, so site:8067 for my cpanel wont work, plus these are
> windows, so I can't SSH to my server :(). Sorry I can't give an
> example, reply back if you have problems.
>
> Good luck with it, Linda.
> Reguards,
> Jacob.
>
> On Feb 10, 10:54 am, Linda <[email protected]> wrote:
> > > I would recommend Linda learning modern HTML, CSS and some PHP.
> >
> > That's the point of asking questions...to learn.
> >
> > >I would recommend hitting upwww.dynamicdrive.com
> >
> > Thank you very much, Matt.
> >
> > Linda
> >
>
--
-Richard Aday
--~--~---------~--~----~------------~-------~--~----~
--
You received this because you are subscribed to the "Design the Web with CSS"
at Google groups.
To post: [email protected]
To unsubscribe: [email protected]
-~----------~----~----~----~------~----~------~--~---