How do I put a menu below the logo?

Asked

Viewed 435 times

0

I’m not getting my menu to appear on index. How do I put the menu under the logo?

This is the code:

<html>
 <head>
  </head>
  <body>
   <img src="img/belo.jpg" alt="" width="250" height="80" align="left"> 
   <img src="img/belo.jpg" alt="" width="250" height="80" align="right"></div>

   <id="Logo"><center><h2><b>CONTROLE DE ESTOQUE</b></center></h2>
   <br>

   <div id="center"><a href="menu.html" target="menu.html"></div>

  • 2

    Give a little more details, post your code... The way the question is getting hard we can help you.

  • it just appears the logo plus nothing from the menu below

  • Are you wearing a </div> to close a <div> which has not been opened anywhere and therefore does not even exist. You are using an html tag <id="Logo">, but there is no HTML tag called <id>.

1 answer

2

It’s because there’s no menu in your code.

A HREF is used to link a page in the sense that it is accessed by clicking on something, for example:

<a href="http://answall.com'>Clique aqui para acessar o Stack Overflow em Português</a>


What you look for, if you want to include one HTML inside another, is a INCLUDE. And this depends on the server.

See an example in PHP:

<html>
<head>
</head>
<body>
   <img src="img/belo.jpg" alt="" width="250" height="80" align="left"> 
   <img src="img/belo.jpg" alt="" width="250" height="80" align="right">
   <div id="Logo"><center><h2><b>CONTROLE DE ESTOQUE</b></center></h2></div>
   <br>
   <div id="center">
<?php include( 'menu.html'); ?>
   </div>
</body>
</html>

See an example of Apache SSI (server side include):

<html>
<head>
</head>
<body>
   <img src="img/belo.jpg" alt="" width="250" height="80" align="left"> 
   <img src="img/belo.jpg" alt="" width="250" height="80" align="right">
   <div id="Logo"><center><h2><b>CONTROLE DE ESTOQUE</b></center></h2></div>
   <br>
   <div id="center">
<!--#include virtual="/menu.html" -->
   </div>
</body>
</html>

Both solutions depend on the server being configured for this.

The Iframe:

I don’t recommend it, but one possibility is to use a <iframe> to load the menu:

<html>
<head>
</head>
<body>
   <img src="img/belo.jpg" alt="" width="250" height="80" align="left"> 
   <img src="img/belo.jpg" alt="" width="250" height="80" align="right">
   <div id="Logo"><center><h2><b>CONTROLE DE ESTOQUE</b></center></h2></div>
   <br>
   <iframe src="menu.html" width=600 height=200></iframe>
</body>
</html>

Note: Fixed a DIV ID that was wrong too.

  • id is somehow blocking the script

  • @Marcelojavasilva see the note I put at the end

Browser other questions tagged

You are not signed in. Login or sign up in order to post.