<div class="section" id="menu"> or <div class="subsection" id="menu">

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

Hello,
I tried to include the menu on different pages using
<?php include_once "menu-italiano.html"; ?>
or whatever the menu is called depending on the language.
The menu is inserted on pages which already have a main heading with
a <div class="section" id="...">
Now the problem is that I would like to use a model where the main heading
of the menu is not as much important as the main heading of the whole page
and the menu is regarded as just a part of it. Therefore I thought that I
would use <div class="subsection" id="menu">
However the html file menu-italiano.html does not validate
http://www.htmlhelp.com/cgi-bin/val...a-gigi.com/it/menu-italiano.html&warnings=yes
Now I wonder:
whether I should add the document type declaration even if it is a file
which is included and which place in the hierarchy the first <div class> in
the menu should have, the first (section) or the second (subsection)?
The former would suit the inserted html document as such but the latter
would suite the structure of the whole main page where the menu is inserted,
wouldn´t it?
 
J

Jonathan N. Little

Luigi said:
Hello,
I tried to include the menu on different pages using
<?php include_once "menu-italiano.html"; ?>
or whatever the menu is called depending on the language.
The menu is inserted on pages which already have a main heading with
a <div class="section" id="...">
Now the problem is that I would like to use a model where the main heading
of the menu is not as much important as the main heading of the whole page
and the menu is regarded as just a part of it. Therefore I thought that I
would use <div class="subsection" id="menu">
However the html file menu-italiano.html does not validate
http://www.htmlhelp.com/cgi-bin/val...a-gigi.com/it/menu-italiano.html&warnings=yes

Whoah! First read the error message! 'section' vs 'subsection' has
nothing to do with the error:

Line 1, character 1:
<div class"subsection" id="menu">
^
There is you error, no '=' should be

Now I wonder:
whether I should add the document type declaration even if it is a file
which is included and which place in the hierarchy the first <div class> in
the menu should have, the first (section) or the second (subsection)?
The former would suit the inserted html document as such but the latter
would suite the structure of the whole main page where the menu is inserted,
wouldn´t it?
 
M

Martin Jay

Luigi Donatello Asero said:
However the html file menu-italiano.html does not validate
http://www.htmlhelp.com/cgi-bin/validate.cgi?url=https://www.scai
ecat-spa-gigi.com%2Fit%2Fmenu-italiano.html&warnings=yes
Now I wonder:
whether I should add the document type declaration

Why not validate it as part of document it's included in?

Let's say index.php includes menu-italiano.html. Validate index.php and
menu-italiano.html is validated at the same time.

You can't have two document type declaration in the same HTML document.

I prefer to put menus at the top of the HTML document, something like
this:

<h1>Main heading</h1>

<div class="menu">
<h2>Menu</h2>
<ul>
<li>Menu item</li>
<li>Menu item</li>
<li>Menu item</li>
</ul>
</div>

<div class="main_text">
<h2>Document text</h2>
<p>Blah, blah, blah...</p>
</div>
 
L

Luigi Donatello Asero

L

Luigi Donatello Asero

Martin Jay said:
Why not validate it as part of document it's included in?

Let's say index.php includes menu-italiano.html. Validate index.php and
menu-italiano.html is validated at the same time.

You can't have two document type declaration in the same HTML document.

No, I cannot. So the only way seems to try and validate only the main
document which includes the menu as well.
Now https://www.scaiecat-spa-gigi.com/it/benvenuti.php validates
I prefer to put menus at the top of the HTML document, something like
this:

<h1>Main heading</h1>

<div class="menu">
<h2>Menu</h2>
<ul>
<li>Menu item</li>
<li>Menu item</li>
<li>Menu item</li>
</ul>
</div>

<div class="main_text">
<h2>Document text</h2>
<p>Blah, blah, blah...</p>
</div>
--

Well, I have a <div class="subsection" id="head">
in between with a kind of introduction.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top