background-image rollover problem ie6

This is a discussion on "background-image rollover problem ie6" within the Web Page Design section. This forum, and the thread "background-image rollover problem ie6 are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Apr 7th, 2008, 09:57
New Member
Join Date: Apr 2008
Location: uk, bristol
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
background-image rollover problem ie6

hey all,
im currently trying to get to grips with pure css layouts, im not doing too bad, but im having problems with browser compatability. this is my current project http://www.robotnic.co.uk/ ive got the rollovers working on ie7 and firefox on both mac an pc but not in ie6 this is my code:

Code: Select all
 
#left a{
 margin-bottom: 6px;
 display: block;
 padding: 18px;
 background-image: url(../img/button_bg1.jpg);
 color: #0f0;
 text-decoration: none;
 width: 100%;
}
html>body #left a {
 width: 214px;
}
#left a:hover{
 background-position: -274px;
}
i would appreciate it if anybody could shed some light on this, also, is there an integrated development environment that allows you to test browser compatability as you go. I dont have ie6 installed so its difficult to test? alternatively, does anybody have any work flow tips on working with multiple browsers? do you just install every browser?? what about ie, can back level versions co-exist on the same computer?? also, i have to post test pages online so friends with macs can test them and send me screen shots, which is not ideal. is there a work around??

thanks in advance

ukstoner

Last edited by Aso; Apr 7th, 2008 at 11:20.
Reply With Quote

  #2 (permalink)  
Old Apr 7th, 2008, 11:23
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,011
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: background-image rollover problem ie6

Multiple IE allows you to install IE 6 (and optionally IE <6, though I would only recommend you need 6) whilst IE 7 is on your system.

Try removing;
Code: Select all
html>body
to solve your issues.
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #3 (permalink)  
Old Apr 7th, 2008, 13:18
New Member
Join Date: Apr 2008
Location: uk, bristol
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: background-image rollover problem ie6

cheers - that multipleIE was exactly what i was looking for, foremore it has enabled me to fix my rollover problem:

Code: Select all
 
#left li{
 margin: 0px;
 margin-bottom: 6px; 
}
#left a{
 display: block;
 padding: 18px;
 background-image: url(../img/button_bg1.jpg);
 color: #0f0;
 text-decoration: none;
 width: 214px;
}
#left a:hover{
 background-position: -274px; 
}
i moved the margin-bottom attribute to the LI rather than the A and changed the width of the A to a px measurment rather than a percentage it works fine now! it has also enabled the stylesheet to work with both Firefox and IE back to ver6 without subsitution. I wasnt quite sure what you were suggesting i did with html>body!? also what was the reasoning in not installing anything less than ie6 - i took your advice...
Reply With Quote
  #4 (permalink)  
Old Apr 7th, 2008, 15:06
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,761
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: background-image rollover problem ie6

Multiple IE's is good. Got IE 5.5 - 8 with IE 7 standalone on m Parallels install and IE 5.5, IE 6 default and IE 7 Standalone on my boot camp install. Works well, saves loads of headache. Although IE 8 is a turd atm and should generally be avoided for at least the next 6 months.

as for your problem try this

Code: Select all
#left a{
 margin-bottom: 6px;
 display: block;
 padding: 18px;
 background: url(../img/button_bg1.jpg)no-repeat 0px 0px;
 color: #0f0;
 text-decoration: none;
 width: 100%;
}
html>body #left a {
 width: 214px;
}
#left a:hover{
 background: url(../img/button_bg1.jpg) no-repeat 0 -274px;
}
You can specify the background position in the background call itself e.g. left top, right center, etc etc.. And yes numerical values work as well.
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)

Last edited by moojoo; Apr 7th, 2008 at 15:09.
Reply With Quote
  #5 (permalink)  
Old Apr 7th, 2008, 17:56
Aso's Avatar
Aso Aso is offline
Chief Moderator

SuperMember
Join Date: Oct 2007
Location: UK
Posts: 1,011
Blog Entries: 2
Thanks: 5
Thanked 23 Times in 20 Posts
Send a message via Skype™ to Aso
Re: background-image rollover problem ie6

Quote:
Originally Posted by ukstoner View Post
I wasnt quite sure what you were suggesting i did with html>body!?
html>body is an IE6 bypass hack that allows you to style elements for other (modern) browsers. This is why I suggested removing it, since IE6 was currently ignoring;
Code: Select all
html>body #left a {
 width: 214px;
}
Quote:
Originally Posted by ukstoner View Post
also what was the reasoning in not installing anything less than ie6 - i took your advice...
It's a shared belief (and personal opinion) that IE<6 have had their day, with an (extremely) small user base. And with the launch of IE8 in anticipation, soon will be the same for IE6 (hopefully ).
Last Blog Entry: The Google Misconception (Feb 3rd, 2008)
Reply With Quote
  #6 (permalink)  
Old Apr 8th, 2008, 09:52
New Member
Join Date: Apr 2008
Location: uk, bristol
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: background-image rollover problem ie6

after installing Multiple IE would i be right in saying that my ver7 is set to stand alone? have you any idea what to expect when windows decides to upgrade me to ver8??
Reply With Quote
  #7 (permalink)  
Old Apr 9th, 2008, 14:00
moojoo's Avatar
Moderator
Join Date: Aug 2005
Location: Texas
Age: 31
Posts: 1,761
Blog Entries: 1
Thanks: 0
Thanked 18 Times in 18 Posts
Send a message via AIM to moojoo Send a message via MSN to moojoo Send a message via Yahoo to moojoo
Re: background-image rollover problem ie6

My experience IE 8 broke my stand alones, so I rolled back to 7. IE 8 is far from ready and should be labled as alpha not beta. I would stick with 7 or even 6 as default and use the standalones for what versions you need. I install 5.5, 6, 7 just in case a client etc requires IE 5 compatability.

IE 8 is still lacking a lot of its "promised" features and should be avoided for a while.

http://www.mevans76.com/blog/ie-8-first-look
__________________
The internet is just a fad.
http://www.mevans76.com
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Reply With Quote
Reply

Tags
css, ie6 problem, rollovers

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
[SOLVED] div background image problem in ie Rincewind Web Page Design 7 Nov 30th, 2007 09:30
Problem with my footer background image in IE dthomas31uk Web Page Design 3 Jul 1st, 2007 12:49
Background Image Problem - Challenge! lgmgroup Web Page Design 2 Jan 23rd, 2007 16:09
problem with iframe background image in IE dudeman Web Page Design 1 Apr 19th, 2006 01:13
Rollover Image Problem! edejo JavaScript Forum 2 Dec 16th, 2005 01:44


All times are GMT. The time now is 07:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43