Topic: Is this css legal? (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: Australia |
![]() 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 |
![]() 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 |
![]() 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 |
![]() 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 |
![]() |
Paranoid (IV) Inmate From: Cold Sweden |
![]() 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 |
![]() 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 |
![]() yeh its not really a css issue :P.. |