This is a discussion on "[SOLVED] How to make a div a link" within the Web Page Design section. This forum, and the thread "[SOLVED] How to make a div a link are both part of the Design Your Website category.
|
|
|
|
|
![]() |
||
[SOLVED] How to make a div a link
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
[SOLVED] How to make a div a link
Hi all,
I have a div with a background image, and am trying to make the div a link. A class sould be easier as then I could apply it to rest of the buttons. Any help will be greatly appreciated Dan
|
|
|
|
||||
|
Re: How to make a div a link
You would have to do something like:
|
|
|||
|
Re: How to make a div a link
Nice and simple
Cheers Marc |
|
|||
|
Re: [SOLVED] How to make a div a link
As Marc said, you should use a <span>, not a <div>. If you use a <div>, you will likely make invalid code.
As a general rule, don't put block-level elements (such as <div>) inside inline elements (such as <a>). See this W3C explanation: Quote:
Last edited by MikeHopley; Nov 30th, 2007 at 08:43. |
![]() |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to make a div become visible on clicking a link? | snappy | Web Page Design | 12 | Jun 11th, 2008 19:25 |
| [SOLVED] How to make an expand / collapse menu | sing2trees | JavaScript Forum | 4 | Apr 14th, 2008 12:16 |
| [SOLVED] joining 2 queries together to make 1 query | AdRock | Databases | 0 | Nov 18th, 2007 21:37 |
| [SOLVED] How do I Make Content available for download | chrissmith | Starting Out | 4 | Nov 11th, 2007 10:13 |
| [SOLVED] How to make the PM pop up box? | Monie | JavaScript Forum | 31 | Nov 7th, 2007 08:38 |