Topic: Is this css legal? (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Australia |
posted 06-07-2006 09:42
Heh.. well legal sounds a bit harsh, but... code: <a href="somewhere"> <h1>Some heading</h1> <p>Some paragraph</p> <img src="animage.jpg" /> </a> |
Paranoid (IV) Inmate From: London |
posted 06-07-2006 10:42
The problem here is that you have block level level elements inside an inline element, this is generally not allowed. |
Maniac (V) Mad Librarian From: the space between us |
posted 06-07-2006 11:55
i actually think that the HTML! is not legal here. you cant put a paragraph, a h1 and an image all into one anchor, can you? |
Bipolar (III) Inmate From: Australia |
posted 06-07-2006 13:40
well you use it normally around <img /> tags to make an image link, so maybe its okay to to this to any other elements? |
Lunatic (VI) Inmate From: under the bed |
posted 06-07-2006 14:37 |
Paranoid (IV) Inmate From: Cold Sweden |
posted 06-07-2006 15:26
quote:
quote:
code: <h1><a href="somewhere">Some heading</a></h1> <p><a href="somewhere">Some paragraph</a></p> <div><a href="somewhere"><img src="animage.jpg" /></a></div> |
Paranoid (IV) Inmate From: London |
posted 06-07-2006 16:02
Well, what you are doing is trying to change the behaviour of the the browser to some small extent, thus one way to go about this would be to use JavaScript to catch an onClick event on a surrounding div and run your desired function. |
Bipolar (III) Inmate From: Australia |
posted 06-07-2006 16:25
yeh its not really a css issue :P.. |