not valid HTML error

J

John Salerno

I got this error while validating my page:

document type does not allow element "UL" here; assuming missing "LI"
start-tag.

Here's the suspicious code. The problem seems to be that I can't nest
list blocks within other list blocks. But if not, how can I create this
"subnote" effect?

Thanks.


<ol>
<li>XRC creates an <code>object</code> node that represents the
particular widget you are making.</li>
<li>Instead of the call to <code>wx.Button</code>, XRC uses a
<code>class</code> attribute with the value "wxButton."</li>
<ul>
<li>Note that XRC can only use the C++ class names, i.e.
there is no dot operator.</li>
</ul>
<li>XRC uses an attribute called <code>name</code> to refer to
this object in your Python program. The <code>name</code> attribute
actually corresponds to the <code>id</code> parameter in the widget's
constructor. You assign it a string value in the XRC file and wxPython
will create a unique ID for it internally.</li>
<ul>
<li>This value does <em>not</em> have to be the same as the
name of the variable you will use to refer to this widget in your
program. The value of <code>name</code> is not the name you will use to
refer to this object in your program.</li>
</ul>
<li>Once this object node is created, the keyword parameters of
the Button's constructor become child nodes, each with the value of that
particular argument. So here we have the <code>label</code> node created
with the text that will appear in the Button, just as if we had manually
written the Button constructor with the <code>label</code> argument.</li>
<li>The <code>parent</code> argument is not created as a child
node. Instead, the entire Button object node will be a child node of a
Panel object, which in turn will be a child node of a Frame object. This
is how wxPython knows the parent-child relationship. Below you can see
the entire structure of a Frame with a Button.</li>
</ol>
 
E

Els

John said:
I got this error while validating my page:

document type does not allow element "UL" here; assuming missing "LI"
start-tag.

Here's the suspicious code. The problem seems to be that I can't nest
list blocks within other list blocks. But if not, how can I create this
"subnote" effect?

Your code:
<ol>
<li>....</li>
<li>....</li>
<ul>
<li>....</li>
</ul>
<li>....</li>
</ol>

Correct code:

<ol>
<li>....</li>
<li>....
<ul>
<li>....</li>
</ul>
</li>
<li>....</li>
</ol>
 
J

John Salerno

John said:
I got this error while validating my page:

I wonder if someone could explain this to me also. It validates, but I
don't understand the warnings:

Warnings
URI : http://python.johnjsalerno.com/xrc_tutorial.css

* Line : 6 (Level : 1) This property applies to block-level
elements. : h1
* Line : 12 (Level : 1) You have no color with your
background-color : .codeblock

Valid CSS information

* body {
o font : small/1.5em Verdana, Helvetica, Arial, sans-serif;
}
* h1 {
o text-align : center;
}
* .codeblock {
o font : medium/1.2em monospace;
o border : thin dotted gray;
o background-color : #ebe5e5;
}
 
E

Els

John said:
I wonder if someone could explain this to me also. It validates, but I
don't understand the warnings:

Warnings
URI : http://python.johnjsalerno.com/xrc_tutorial.css

* Line : 6 (Level : 1) This property applies to block-level
elements. : h1

This one is superfluous imo, as h1 *is* a block-level element. It's
perfectly correct and logical to set text-align:center for h1. I don't
know why the validator feels the need to call your attention to it.
* Line : 12 (Level : 1) You have no color with your
background-color : .codeblock

This is because you have not set a colour for the text in .codeblock.
This could potentially cause an inherited text colour to be the same
as the set background-color. Not an error, but a warning to pay
attention to styles that could cause problems in certain situations.
 
J

John Salerno

Els said:
This is because you have not set a colour for the text in .codeblock.
This could potentially cause an inherited text colour to be the same
as the set background-color. Not an error, but a warning to pay
attention to styles that could cause problems in certain situations.

Thanks once more! If I wanted to do this, would I just use the 'color'
property to set text color? It seems too general of a name, but that's
what's listed on the reference site I'm looking at.
 
J

John Salerno

John said:
Thanks once more! If I wanted to do this, would I just use the 'color'
property to set text color? It seems too general of a name, but that's
what's listed on the reference site I'm looking at.

Nevermind, a simple test showed that this is the property to use! Seems
like it should be 'text-color', or something more specific...
 
J

John Salerno

Jukka said:
Scripsit John Salerno:


How did you get that warning? Using the W3C "CSS Validator" on your CSS
code, I get no such message, even when I have selected "All" in the
"Warnings" menu.

Hmm, I just tried it again and you're right, it's not there now. But it
was earlier, and I haven't changed it since then.
 
J

John Salerno

John said:
Interesting, thanks. I did notice the IE did some funky stuff with the
fonts, so I changed it to what it is now. Perhaps I should do % instead.

Eh, I don't like this. I tried 100% for the body, but that was way too
big, so I did 75%. It's okay but not as nice as just putting "small".

However, I don't know quite what to do with the size of .codeblock. Is
it a percentage of the body? So if I put 75%, it is 75% of the size of
whatever body is, or 75% of some preset font?
 
B

Beauregard T. Shagnasty

John said:
Eh, I don't like this. I tried 100% for the body, but that was way
too big, so I did 75%. It's okay but not as nice as just putting
"small".

So reduce the size of your own browser's default font. Don't mess with
mine, though. If you use 100%, everyone gets their own preferred set
size, which is the idea of pages on the WWW.

Did you remove the Verdana? I don't have that on my computer. (It's not
Windows.)
However, I don't know quite what to do with the size of .codeblock.
Is it a percentage of the body? So if I put 75%, it is 75% of the
size of whatever body is, or 75% of some preset font?

It would be a percentage of the parent. Is "codeblock" supposed to be
larger, smaller, or the same as the main content (body) font?

If it is supposed to be a tad smaller than main content, set it to 90%.
Also, do you need to set the line-height? That's not normally done.
 
J

John Salerno

Beauregard said:
Did you remove the Verdana? I don't have that on my computer. (It's not
Windows.)

No, I keep that there for the default on Macs.
If it is supposed to be a tad smaller than main content, set it to 90%.
Also, do you need to set the line-height? That's not normally done.

I think this looks ok. Is it proper?

body {
font: 100%/1.5em Verdana, Helvetica, Arial, sans-serif;
}

h1 {
text-align: center;
}

..codeblock {
font: 100%/1.5em monospace;
border: thin dotted gray;
background: #ebe5e5;
}
 
B

Beauregard T. Shagnasty

John said:
No, I keep that there for the default on Macs.

But what about Linux users?
I think this looks ok. Is it proper?

body {
font: 100%/1.5em Verdana, Helvetica, Arial, sans-serif;
}

Note that Verdana is considerably larger than the others in your list.
Are you sure you need a larger font (that some don't have)? Did you see
the page: <http://www.xs4all.nl/~sbpoley/webmatters/verdana.html>

The rest looks ok to me.
 
J

Jukka K. Korpela

Scripsit John Salerno:
Hmm, I just tried it again and you're right, it's not there now. But
it was earlier, and I haven't changed it since then.

Strange indeed.

Earlier, I get an "internal error" message from the "CSS Validator", but
retrying with the same URL gave a normal report. Maybe there's something odd
in the software right now.

I can't trigger the warning quoted above even if I explicitly try it, by
adding
h1 { display: inline; }
(This could conceivably make a checker warn about properties that do not
apply to inline elements. Probably not very useful, but conceivable.)

The error message itself is listed in
http://jigsaw.w3.org/css-validator/org/w3c/css/util/Messages.properties
but with no useful comment.
 
B

Beauregard T. Shagnasty

John said:
Interesting stuff. So based on that page, should I not specify font
families at all? Or just remove Verdana?

I tend to agree with Stephen, and not specify Verdana but do specify
others. Normally, I use:

font-family: "Trebuchet MS", Helvetica, Arial, sans-serif;

as I feel the Trebuchet MS is a good-looking Windows font and the
fallbacks are reasonable as well. But they ain't huge. <g>
 

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
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top