iEntry 10th Anniversary Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > HTML, XHTML and CSS

Reply
 
LinkBack Thread Tools
Old April 16th, 2008, 12:01 AM   #1
New Member
 

Join Date: Nov 2007
Location: Michigan
Age: 23
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Aerdan is on a distinguished road
CSS Background-Position Rollover Broken in IE

This displays properly in Firefox with the rollover, and the image itself appears in Internet Explorer. However, IE doesn't hover properly nor does it indicate it's a link (with the hand), but it's still clickable. Here's the CSS and then the code used to make it happen. Anyone know how to fix this?

Link to Site (New Thread button)

CSS
Code:
.newthread a {
    display:block;
    width:105px;
    height:24px;
    background:url(../../images/cb-template-1/buttons/newthread.png);
}

.newthread a:hover {
    background-position: 0 -24px; }
HTML
Code:
<div class="newthread">
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="clear.gif" alt="$vbphrase[post_new_thread]" border="0" /></a>
</div>
Aerdan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 16th, 2008, 08:58 AM   #2
Aso
Most Reputable Member
 

Join Date: Oct 2007
Location: UK
Posts: 1,633
Blog Entries: 2
Thanks: 22
Thanked 84 Times in 79 Posts
Rep Altering Power: 0 Aso is on a distinguished road
Re: CSS Background-Position Rollover Broken in IE

Try this instead;
Code:
.newthread a {
    display:block;
    width:105px;
    height:24px;
    background:url(../../images/cb-template-1/buttons/newthread.png);
    overflow: hidden;
}

.newthread a img {
   border: none;
}

.newthread a:hover {
    background-position: 0 -24px;
    text-indent: -5000px
}
HTML
HTML Code:
<div class="newthread">
<a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="../../images/cb-template-1/buttons/newthread.png" alt="$vbphrase[post_new_thread]" /></a>
</div>

Last edited by Aso; April 16th, 2008 at 09:00 AM..
Aso is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Old April 16th, 2008, 04:54 PM   #3
New Member
 

Join Date: Nov 2007
Location: Michigan
Age: 23
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 Aerdan is on a distinguished road
Re: CSS Background-Position Rollover Broken in IE

Hey everyone, the problem was solved. For sake of knowing the actual problem and the solution, here's what happened:

The PNG files I use have transparency in them. Because of this, I have a separate file that fixes the alpha transparency for IE. A common problem with this approach is the inability to select anything within the container. What I did was turn the gray part of the button into a background. Within that container, using position:relative to "fix" a layer above it, I did the same thing with just a .jpg file as the background image that rolls over. End result:

http://www.castbuzz.com/community/forumdisplay.php?f=20

CSS
Code:
.buttongray {
    display:block;
    width:105px;
    height:24px;
    background:url(http://www.castbuzz.com/community/images/cb-template-1/buttons/button.png);
    overflow:hidden;
    padding:0px;
    margin:0px;
}

.newthread a {
    display:block;
    position:relative;
    width:92px;
    height:16px;
    background:url(http://www.castbuzz.com/community/images/cb-template-1/buttons/newthread.jpg);
    overflow:hidden;
    padding:0;
    margin:2px 0 0 4px;
}

.newthread a:hover {
    background-position: 0 -16px;
    text-indent: -5000px;
    padding:0;
    margin:2px 0 0 4px;
}
HTML (within vB)
Code:
<div class="buttongray"><div class="newthread"><a href="newthread.php?$session[sessionurl]do=newthread&amp;f=$foruminfo[forumid]" rel="nofollow"><img src="clear.gif" width="94" height="16" alt="" /></a></div></div>
Aerdan is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Background-Position Causes IE to Scroll Aerdan HTML, XHTML and CSS 2 May 10th, 2008 09:37 PM
background-image rollover problem ie6 ukstoner HTML, XHTML and CSS 6 April 9th, 2008 10:00 AM
Background colour rollover? crackafaza HTML, XHTML and CSS 6 April 4th, 2008 06:22 AM
a:hover and background-position issue with ie6 mezema HTML, XHTML and CSS 5 June 15th, 2006 11:32 AM
background-position:bottom; <-- not working ? ifunky2 HTML, XHTML and CSS 2 February 14th, 2006 05:56 PM


Search Engine Optimization by vBSEO 3.2.0 RC8