1

Running the Ubuntu cloud page http://www.ubuntu.com/business/cloud/overview through http://validator.w3.org/ gives several errors, the majority of which are centred around not having <divs> and <h>s etc. within an <a> tag.

The implementation I'm interested in is the four boxes with arrows, which change colour as you hover over them (as they are <a> links). What is the valid method to implement this?

2
  • The way to implement that would be CSS. Why is it so important to you that the markup validates? Commented Jun 2, 2011 at 22:08
  • I can implement similar features myself, it was more whether there was a 'correct' way of doing it which validated. It doesn't really bother me either way if it validates or not, just was a point of interest! Commented Jun 2, 2011 at 22:11

2 Answers 2

1

Valid ways to implement this:

  • separate links inside each block. Put the :hover effect on the parent div, not the link. Downside: more markup

  • use only inline elements inside a single link, using CSS to change them into display: block elements if necessary. Downside: potentially less semantic

  • use an HTML5 doctype, as [X]HTML5 allows this construction. Downside: the less easy-to-validate current moving-target nature of HTML5.

Sign up to request clarification or add additional context in comments.

Comments

0

Each one of those can be a (with a :hover effect to change the background color/image), and the , which sits inside, just covers the entire div with a height and a width in your CSS.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.