strict xhtml and css

M

MWSunshine

Hi !

I would like to make a nice menu on my page. The menu should be located on
the eleft side. You can see it on:
http://www.republika.pl/mwsunshine/index3.html
The problem is that I nested a table in DIV to have the possibility of
highlight the menu contents when the mouse is moved over the link.
But it seems to be not allowed in xhtml - validator is comlaining about
table in this place.
But if table is not allowed there - how can i achieve the same effect
without table?

MWSunshine
 
N

Nick Howes

brucie said:

You should do as brucie as done, and take advantage of style sheets. This is
part of the general move in HTML towards markup that represents what it is,
rather than random tables. And menus are lists, generally, so why not write
it out as such and then style them?

also i think that script tag on the first line is probably invalid... would
be better in the <head> element. unless that is added by your host
 
W

Webcastmaker

But if table is not allowed there - how can i achieve the same effect
without table?

Drop the table, then put the links in an unordered list <ul>. Use CSS
to change the size and color of each of the list items in the ul.
 
A

Andy Dingley

MWSunshine said:
I would like to make a nice menu on my page. The menu should be located on
the eleft side. You can see it on:
http://www.republika.pl/mwsunshine/index3.html

The problem is that I nested a table in DIV to have the possibility of
highlight the menu contents when the mouse is moved over the link.

You don't need to do this.

The "CSS mouse highlight" trick relies on using the CSS :hover
pseudo-class. This only works on the <a> element, so usually you need
to place this inside a container element (<li> or <td>) and set the
width of the <a> to 100% so that the varying background fills its
container.

There is no requirement for an extra "list level" container element
though. You probably need to add an id or class attribute so as to
associate the CSS with it, but you can add that to the table element
itself just as easily.

But it seems to be not allowed in xhtml - validator is comlaining about
table in this place.

No, the validator is complaining about lots of things, but not that.

For one thing, you need to avoid that <script> element at the top of
file before the doctype. If this is added by your hosting company,
then I'm sorry but you'll never have valid mark-up.

You also re-use the same id attribute value in many places, which
isn't valid. Think about using a class attribute here instead, or else
just inferrring the CSS from the parent's class or id.

And please don't wave "Valid XHTML" buttons around when it isn't.
 
B

brucie

in post: <
Andy Dingley said:
The "CSS mouse highlight" trick relies on using the CSS :hover
pseudo-class. This only works on the <a> element,

the specs don't specify which elements the :hover pseudo class can apply
to so it can apply to all. its just some old crappy browsers only apply
it to the said:
and set the width of the <a> to 100% so that the varying background
fills its container.

display:block; is all thats needed, again its just some crappy old
browsers that require the width:100%
 
R

Ryan Stewart

brucie said:
in post: <

the specs don't specify which elements the :hover pseudo class can apply
to so it can apply to all. its just some old crappy browsers only apply
it to the <a>
There are browsers that actually support it? Which?
 
M

MWSunshine

And please don't wave "Valid XHTML" buttons around when it isn't.

I am not doing this. It was experimental before i did the things with menu.
When I was given an information that this page is no longer valid xhtml - i
just uploaded it in temporar place to have a possibility to show it for
better explanation of what i did. I did no modification. In this place where
you could see it - we could say that it is not published. Only you know that
this page is there ... :)

MWSunshine
 
R

Ryan Stewart

Mark Parnell said:
[:hover on elements other than said:
There are browsers that actually support it? Which?

Pretty much anything more recent than NS4, except IE.
You're right. I thought I had tested it on Mozilla and FireFox, but I had a
CSS error. Oops :)
 
B

brucie

in post: <
So what you're saying is that you need to stick with both of these ?

no, i'm saying "some crappy old browsers" is my polite way of referring
to the total pile of shit known as IE (although it can apply to others).
upgrade.
 
A

Andy Dingley

no, i'm saying "some crappy old browsers" is my polite way of referring
to the total pile of shit known as IE (although it can apply to others).

I know. But people do insist on using it.

What ? Go round and do _all_ of my users ?
 
R

rf

brucie said:
in post: <


people are stupid



yes, every single one. if they refuse to upgrade beat them to death.

Not a good idea. One should merely beat them to a bloody pulp so all they
can do all day is sit in bed with a notebook looking at... web sites.
 
W

Webcastmaker

people are stupid

The quality of IE (and other browsers) and the stupidity of users,
are the only thing we can count on. Because of this, we have to
design to those specs.
 
W

Webcastmaker

Not a good idea. One should merely beat them to a bloody pulp so all they
can do all day is sit in bed with a notebook looking at... web sites.

We could pull a Dr Brodsky (Kubrick fans will understand that)
 

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

Similar Threads

Stuck with html and css 25
IE/Firefox XHTML Strict 7
Blockquote in Strict XHTML 5
XHTML strict 4
xhtml table attributes 33
css design 7
XHMTL and CSS Problem 14
Html 4.01 strict instead of xhtml? 5

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top