Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
block link not working in IE
Old 07-07-2009, 02:29 PM block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
I have some DIVS that I have text links in. I would like the whole div to be a link. I would like it so that when the user rolls the mouse over any part of the div it is a link and the hover style kicks in which in this case will change the background of the div.

This works ok in FF but not in IE7.

Here is what I've got so far, any ideas:

Code:
.button {
    height:20px;
    line-height:20px;
    background-color:#FFCCFF;
    float:right;
    margin-top: 1px;
    border:#999999 1px solid;
    text-align:center;
    padding:0px;
    display: block;
    font-weight:bold;
    }
.button a, .button a:active, .button a:focus  {
    color:#000000;
    display: block;
    text-decoration: none;
    background-color:#96D2F3;
    }
.button a:hover {
    color:#000000;
    display: block;
    text-decoration:none;
    background-color:#00FF00;
    }
Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-07-2009, 02:52 PM Re: block link not working in IE
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
I would like the whole div to be a link
You really cannot do this, not with VALID code. It would be invalid to wrap div inside <a></a> tags.

Now, standards-compliant browsers will take the hover pseudo-class on elements besides the <a> tag, but IE won't, and that still wouldn't make it a link.

Need to see all the code or a URL though.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 02:55 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
You can see it on the 'buy now' and 'more info' buttons: http://electriccoolbox.org.uk/

<div class="button button-right">buy now</div>
<div class="button button-left">more info</a></div>

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 03:28 PM Re: block link not working in IE
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
a technique i used that works on IE7+, FF, safari and chrome is

.button:hover { background-color: #whteva; }

and to div being a button, you can but not valid.. you can do it for a span tho

<a href="#"><span class="button">Buy Now</span></a>
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 08:11 PM Re: block link not working in IE
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
You can see it on the 'buy now' and 'more info' buttons
Like I said - not valid code.
You could achieve a similar effect w/o the div though, by just using the <a>, specify a height and width to make it the size you want it, along with padding for spacing.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-07-2009, 08:19 PM Re: block link not working in IE
orionoreo's Avatar
Ultra Talker

Posts: 335
Name: Jerry
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Like I said - not valid code.
You could achieve a similar effect w/o the div though, by just using the <a>, specify a height and width to make it the size you want it, along with padding for spacing.

another great and effective technique...
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
orionoreo is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 01:43 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
Quote:
Originally Posted by LadynRed View Post
Like I said - not valid code.
You could achieve a similar effect w/o the div though, by just using the <a>, specify a height and width to make it the size you want it, along with padding for spacing.
So how would that work?

Create a style called button and apply it to the <a> tag?

How would the hover effects get defined and picked up?

Thanks.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 02:51 PM Re: block link not working in IE
LadynRed's Avatar
Defies a Status

Posts: 10,017
Location: Tennessee
Trades: 0
Quote:
Create a style called button and apply it to the <a> tag?
Essentially, yes.

Quote:
How would the hover effects get defined and picked up?
Same as you did for the div, just applied to the <a>.
__________________
Web Goddess & Web Standards Evangelist :) - Tables Be Gone !!

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE

LadynRed is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 04:00 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
Hmm. I've tried this to no avail:

.butt {
background-colorink;
width: 200px;
height: 50px;
}
.butt a:link, .button a:visited {
background-color:yellow;
width: 200px;
height: 50px;
}
.butt a:hover {
background-color:red;
width: 200px;
height: 50px;
}

<a href="#" class="butt">link</a>

Any ideas?
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 06:07 PM Re: block link not working in IE
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
It works fine you need to add more style

Code:
.butt {
background-color: pink;
width: 200px;
height: 50px;
text-align:center;
color:#000;
text-decoration:none;
padding-top:15px;
}
.butt a:link, .button a:visited {
background-color:yellow;
width: 200px;
height: 50px;
}
.butt a:hover {
background-color:red;
width: 200px;
height: 50px;
}
Code:
<a href="#" class="butt">link</a>

Does that help?
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 06:17 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
Doesn't seem to have made a difference I'm afraid.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-08-2009, 06:33 PM Re: block link not working in IE
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
what version of IE are you using. I'm opening it with IE7 an it works fine.
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 02:23 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
IE 7 here too.
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-10-2009, 07:54 PM Re: block link not working in IE
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
okay, can you show me a screenshot. I've got it set up on my webpage

http://konetchreport.com/linktest/

__________________
Alex

Last edited by konetch; 07-10-2009 at 07:56 PM..
konetch is offline
Reply With Quote
View Public Profile
 
Old 07-11-2009, 01:16 PM Re: block link not working in IE
Ultra Talker

Posts: 316
Trades: 0
Firefox:


In IE there is no roll over effect, is there meant to be?

I think I will just use ul li for this.
Attached Images
File Type: jpg link-test.JPG (43.2 KB, 1 views)
Joe3000 is offline
Reply With Quote
View Public Profile
 
Old 07-11-2009, 01:19 PM Re: block link not working in IE
konetch's Avatar
Ultra Talker

Posts: 258
Trades: 0
Okay, that's the technique I use for most menu items. Good luck
__________________
Alex
konetch is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to block link not working in IE
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.33256 seconds with 13 queries