0

Hey everyone i have a little problem with the navigation bar, i have created the design of the menu but i want to be in one file (menu.html) and to show on all pages in the website... here is my code for menu.html

<html>
    <body>
        <meta http-equiv="content-type" content="text/html;charset=utf-8"/>
        <style>
            form.position-and-style {
                opacity:1;
                position:absolute;
                border-radius:20px;
                width:150px;
                left:-1%;
                top:10%;
                height:100px;
                background-color:white;
                border:1px solid gray;
            }
            #pocetna {
                opacity:1;
                position:absolute;
                top:10%;
                left:20%;
                font-feature-settings:normal;
                font-style:normal;
                font-family:sans-serif;
                font-size:15px;
            }
            #kontakt {
                opacity:1;
                position:absolute;
                top:70%;
                left:20%;
                font-feature-settings:normal;
                font-style:normal;
                font-family:sans-serif;
                font-size:15px;
            }
        </style>

        <form class='position-and-style'>
            <a id='pocetna' href='index.html'><b>Почетна</b></a>
            <a id='kontakt' href='sleden_cekor.html'><b>Контакт</b></a>
        </form>

    </body>
</html>

Tell me how can i make this menu appear on all sites i have with out copy and pasting the same code in every single page.
Thank you :)

Edited by Stefan_1: misstake in words

5
Contributors
10
Replies
27
Views
3 Years
Discussion Span
Last Post by mattster
0

Create file called menu.html and save above code to that file.
And include that menu.html file to every page that you want to put menu.

0

But how can i do that, how to include the "menu.html" file into another file for example index.html

0

first tell me that ? do you have any knowledge about php? it can be done using php include. :)
i have descriped above.

0

Im putting the php code under the first <html> tag but doesn't work please tell me where to put the code ?

<html lang=mk>
    <? php include('menu.html'); ?>
    <head>
0

Please i cannot make it i tryed again the same thing on the page you give me but the menu does not appear in the index.html site ...

0

ok..
save menu.html as menu.php
then go to index.html paste this code <?php include("menu.php");?> nd do your coding for index.html

0

index.html must be save as index.php also. Otherwise, anything with <?php will not be parsed by the PHP parser.

There are alternatives to .php extension. PHP parser will parse any files with these extensions

.php
.php3
.php4
.php5
.phtml
.inc // carefull with this one. the source can be viewed from the browser
.tpl
0

Make sure you are running PHP on your server:

## index.php ##
<html>
    <head>
    ...
    </head>
    <body>
        <?php
            include('menu.php');
        ?>
    </body>
</html>


## menu.php ##

<ul>
    <li>...</li>
    ...
</ul>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.