<div class="position"> and <div class" section">

  • Thread starter Luigi Donatello Asero
  • Start date
L

Luigi Donatello Asero

I might have found a basic mistake on my website.
Let´s say that
one page has
a <div class="section" id="some name which refers to the content of the
whole page">
and then a menu with some links on the left side and a menu of content with
a list of links which refer to that page and some other which refer to the
same topic anyway and later the main content. In the end some foot notes.
Now assuming that we use <h1> to display sections, I guess that we should
use <h2> to display subsections
but how should I call the class referring to the menu on the left then?
Should it be a section as well?
Had it been a section I shoud have needed another <h1> there. But that is
not possible because I already have a main heading on the page.
So, should I use something like
<div class="subsection" id="menu">
and then have a heading like
<h2> Menu</h2>
and then
<div class="subsubsection" id="allman">
<h3>Allmänt</h3>
or should I have as I did
<div class="position" id="menu">
and then
<div class="subsection" id="allman">
 
L

Luigi Donatello Asero

Luigi Donatello Asero said:
I might have found a basic mistake on my website.
Let´s say that
one page has
a <div class="section" id="some name which refers to the content of the
whole page">
and then a menu with some links on the left side and a menu of content with
a list of links which refer to that page and some other which refer to the
same topic anyway and later the main content. In the end some foot notes.
Now assuming that we use <h1> to display sections, I guess that we should
use <h2> to display subsections


I mean the headings which refer to sections and subsections here
but how should I call the class referring to the menu on the left then?
Should it be a section as well?
Had it been a section I shoud have needed another <h1> there. But that is
not possible because I already have a main heading on the page.
So, should I use something like
<div class="subsection" id="menu">
and then have a heading like
<h2> Menu</h2>
and then
<div class="subsubsection" id="allman">
allman- allmänt= general content
<h3>Allmänt</h3>
or should I have as I did
<div class="position" id="menu">
and then
<div class="subsection" id="allman">

There seems to be something wrong on
https://www.scaiecat-spa-gigi.com/sv/faktaomitalien.php
when I display it on Opera "Allmänt" is underlined.
Why is it?
 
L

Luigi Donatello Asero

Jonathan N. Little said:
You have nesting errors in your markup. Display results become
unpredictable...

Quite generic answer..my question was more specifical..
 
J

Jonathan N. Little

L

Luigi Donatello Asero

Jonathan N. Little said:
Luigi Donatello Asero wrote:


Specifically then:

<a name="italienska-ligan"</a>

That's not correct and maybe the cause of the mysterious 'underline' Opera

<th id="t5">Regionens läge</tr>

This is also not correct, TH needs to be closed before TR closing tag...

Frankly your code is a mess and a b*tch to debug, sort of semi-formatted
a little indentation could help a lot.

Why does the html validator not show these errors?


https://www.scaiecat-spa-gigi.com/sv/faktaomitalien.php
 
L

Luigi Donatello Asero

Jonathan N. Little said:
Don't know. Not a substitute for a human brain.


I corrected them and I also changed the menu transforming
<div class="position" into
<div class="subsection"
and then changing the headings
but the problem with underlining persists
 
J

Jonathan N. Little

Luigi said:
I corrected them and I also changed the menu transforming
<div class="position" into
<div class="subsection"
and then changing the headings
but the problem with underlining persists


Didn't say it was your *only* mistake! Another one...

<a name="italienskan-ligan"</a>

Could be more.

FWIW Instead of

<a name="some_anchor"></a><p>Some paragraph...</p>

You can make an anchor with an id

<p id="some_anchor">Some paragraph...</p>

and you would be less likely to make the above error.
 
L

Luigi Donatello Asero

Jonathan N. Little said:
It is, but the other errors he has made are not. Also his inconstancy
with closing tags makes it damn confusing!


You did not mention so many errors, actually and on the other hand, if you
had done it and they had not been optional,
the question would have been unanswered that is about why the validator had
not displayed them....
 
L

Luigi Donatello Asero

Jonathan N. Little said:
Didn't say it was your *only* mistake! Another one...

<a name="italienskan-ligan"</a>

Could be more.

FWIW Instead of

<a name="some_anchor"></a><p>Some paragraph...</p>

You can make an anchor with an id

<p id="some_anchor">Some paragraph...</p>

and you would be less likely to make the above error.


Do you mean that I should not have any closing tag?
Or do you mean that "italienska-liga" and
"italienskan-liga" were not consistent?
 
J

Jonathan N. Little

Luigi said:
You did not mention so many errors,

I pointed out some...as I said your coding style is not 'pretty' and not
conducive to debugging.
actually and on the other hand, if you
had done it and they had not been optional,

Yes, in HTML 4.01 some elements have optional closing tags. Personally I
find using all option closing tags makes debugging easier because it set
a definite end to a block of markup analogous to braces '{}' enclosing a
code block in C++ or Perl. However being inconsistent within document
close some but not others (as you have done) is very confusing and make
debugging nearly impossible.

the question would have been unanswered that is about why the validator had
not displayed them....

Don't know I said. Maybe you confused the beejeebers out of it, you have
a gift with confusion.
 
T

Toby Inkster

Luigi said:
Now assuming that we use <h1> to display sections, I guess that we should
use <h2> to display subsections but how should I call the class
referring to the menu on the left then?

Aha! At last a sensible question from Luigi! What is the best way to
structure a page into sections when some of them are not really part of
the document, but are navigation.

I think conventional wisdom is to do something like this:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h2 = Site Search
h2 = Navigation Menu

But do the Site Search and Navigation Menu really deserve to be on the
same level as the main subsection headings? They're not really sections of
the main article.

Currently on my site I'm using:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h6 = Site Search
h6 = Navigation Menu

Which does mark out a distinction between document headings and all those
extra bits that are common on web pages, but it's still not very
satisfying.

I think the best way might be:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h1 = Site Search
h1 = Navigation Menu

Which in my opinion offers the closest match to the logical structure of
the page.

Ultimately the nicest solution would be to not have *any* navigation on
the page:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne

and to use only the humble <LINK> element for navigation; however, even in
browsers that support <LINK>, implementations are not sufficiently good to
be relied on for primary navigation. Perhaps the day will come though.
 
B

Blinky the Shark

Toby said:
Aha! At last a sensible question from Luigi! What is the best way to
structure a page into sections when some of them are not really part of
the document, but are navigation.

Aha! You took the bait! :)
 
L

Luigi Donatello Asero

Jonathan N. Little said:
I pointed out some...as I said your coding style is not 'pretty' and not
conducive to debugging.


Yes, in HTML 4.01 some elements have optional closing tags. Personally I
find using all option closing tags makes debugging easier because it set
a definite end to a block of markup analogous to braces '{}' enclosing a
code block in C++ or Perl. However being inconsistent within document
close some but not others (as you have done) is very confusing and make
debugging nearly impossible.



Don't know I said. Maybe you confused the beejeebers out of it, you have
a gift with confusion.


Sorry, but I think you are wrong.
I agree on that it is better to close tags but I also rely on validators.
Perhaps I should not but the fact is that they also let me spare a lot of
time.
 
L

Luigi Donatello Asero

Toby Inkster said:
Aha! At last a sensible question from Luigi!

I would rather say at last a question from Luigi which you find sensible.


What is the best way to
structure a page into sections when some of them are not really part of
the document, but are navigation.

I think conventional wisdom is to do something like this:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h2 = Site Search
h2 = Navigation Menu

But do the Site Search and Navigation Menu really deserve to be on the
same level as the main subsection headings? They're not really sections of
the main article.


They are not.
But the website deals with several activities and I find it useful that the
user who enters one of its pages
can have an overview of the main contents of the whole website.
Currently on my site I'm using:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h6 = Site Search
h6 = Navigation Menu

Which does mark out a distinction between document headings and all those
extra bits that are common on web pages, but it's still not very
satisfying.

I think the best way might be:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne
h1 = Site Search
h1 = Navigation Menu

Which in my opinion offers the closest match to the logical structure of
the page.


I thought that we were not allowed to use more than one h1 for each page.
What about that?
Ultimately the nicest solution would be to not have *any* navigation on
the page:

h1 = British Royal Family
h2 = The Queen
h2 = Price Charles
h3 = Marriage to Lady Diana Spencer
h3 = Marriage to Camilla Parker-Bowles
h2 = Prince Andrew
h3 = Marriage to Sarah Fergusson
h2 = Prince Edward
h2 = Princess Anne

and to use only the humble <LINK> element for navigation; however, even in
browsers that support <LINK>, implementations are not sufficiently good to
be relied on for primary navigation. Perhaps the day will come though.

I am not sure about what you mean there.
Do you think that websites should look on browsers the same way they do on
text browsers?
 

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

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top