GetDotted Domains

Viewing Thread:
"Making a whole div a link"

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Wed 28/05/03 at 02:56
Regular
Posts: 787
I've got a rectangular
element (bet you never saw that one coming) that just contains a bit of text. I want to make the whole div a hyperlink, so that the user may click anywhere on the div to activate the link.

This..

content


..works perfick in Opera, but not in IE (not tested in Moz). I've had a quick rummage and I can't get google to tell me the answer, so does anyone here know? For the time being, I've got..



..which at least lets IE users click on the content of the div to activate the link, but if anyone knows a better solution off the top of their heads I'd like to hear it.
Wed 28/05/03 at 21:59
Regular
"It goes so quickly"
Posts: 4,083
Makes sence really.

Thanks for the tip.

Liked the example you posted BTW :)
Wed 28/05/03 at 21:58
Regular
"l33t cs50r"
Posts: 2,956
cjh wrote:
> Would you happen to know why the links on this page don't accept the
> full area for a mouseover???
>
> The border is accepted as clickable, as well as the link itself, but
> the space in between is ignored.
>
> http://www.haignet.co.uk/ViceCity/

Easy... you have the background colour set as "transparent" so there is technically nothing there to trigger the event!
Wed 28/05/03 at 21:52
Regular
"It goes so quickly"
Posts: 4,083
Would you happen to know why the links on this page don't accept the full area for a mouseover???

The border is accepted as clickable, as well as the link itself, but the space in between is ignored.

http://www.haignet.co.uk/ViceCity/
Wed 28/05/03 at 21:34
Regular
"l33t cs50r"
Posts: 2,956
Yeap...

Have a look at http://wip.blackwellpublishing.com/wwwsubjsitescorp/

Look at the green menu on the top left... Exactly what your asking for. All CSS and all rather simple...

the HTML:::

Books 

Css::

.sitemenuitem {
display:block;
width:auto;
height:15px;
border:1px solid #999999;
font-family:Arial, Helvetica, sans-serif;
font-size:11px;
margin-left: 0px;
margin-right: 0px;
margin-top:0px;
margin-bottom: 1px;
background-color: #669900;
color: White;
text-decoration:none;
text-align:left;
font-weight: bold;
left: 0px;
padding-left: 5px;
z-index: 200:
}

and...

.sitemenuitem:hover {
background-color:#DDDDDD;
color: #000000;
text-decoration: none;
}

Everytime you put in an href it produces a new box under the first one as per the URL. Look at the source (I've coded it for ease of use) and you'll soon get it.
Wed 28/05/03 at 03:37
Regular
"Eff, you see, kay?"
Posts: 14,156
Google knows the answer to everything, and in this case, it's in its source.

onClick="c('http://groups.google.com/groups', 'wg',event);" style=cursor:pointer;cursor:hand;

...taken from the source of the search page. The c() function is basically a javascript redirect wriiten by themselves, but I'm guessing that's obvious to you.

Unless Alan has a better suggestion...
Wed 28/05/03 at 02:56
Regular
"bing bang bong"
Posts: 3,040
I've got a rectangular
element (bet you never saw that one coming) that just contains a bit of text. I want to make the whole div a hyperlink, so that the user may click anywhere on the div to activate the link.

This..

content


..works perfick in Opera, but not in IE (not tested in Moz). I've had a quick rummage and I can't get google to tell me the answer, so does anyone here know? For the time being, I've got..



..which at least lets IE users click on the content of the div to activate the link, but if anyone knows a better solution off the top of their heads I'd like to hear it.

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Best Provider
The best provider I know of, never a problem, recommend highly
Paul
Brilliant service.
Love it, love it, love it!
Christopher

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.