473,385 Members | 1,867 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

IE6 weird background bug.

Here's the problem as far as I can work out (not a problem in firefox
or ie7)

I have pages with a body with a ID and class. The ID is the page
type, in this case Sub, and with a class of the type of instrument,
this can be guitar, bass, vocal and drum.

So body looks like <body id="sub" class="guitar" or <body
id="sub" class="bass">

Now what I want to do is change the background according to which class
the body has.

So I'm using..

body#sub.bass
{
background: #7a7a7a repeat-x url(img/bg_basssubstars.jpg) ;
}

then

body#sub.guitar
{
background: #7a7a7a repeat-x url(img/bg_guitarsubstars.jpg) ;
}
BUT in IE 6 the second (and third and fourth) attempt to set the
background is ignored. Anyone got any fix other than removing the class
and just using the ID (easier said than done)?

I'm relatively new to CSS so be gentle.

Stew Dean.

Oct 18 '06 #1
3 1594

st******@gmail.com wrote:
Here's the problem as far as I can work out
We need a URL. You have a non-trivial problem and we need to see the
whole picture.
I have pages with a body with a ID and class. The ID is the page
type, in this case Sub, and with a class of the type of instrument,
In general, use class for CSS and not id. You certainly can use id, but
it tends to work better with classes (id is very "strong" in CSS
selectors, so it can get awkward to "sub-class" behaviours on a class
that's already inside an element with a matching id). You can also use
multiple classes on the same element (they go in one class attribute,
separated by spaces).

BUT in IE 6 the second (and third and fourth) attempt to set the
background is ignored.
Validate your code (HTML and CSS) and check that the image URLs
actually work. Chances are that it's some dumb typo you're staring
right at but haven't noticed.

Oct 18 '06 #2

Andy Dingley wrote:
st******@gmail.com wrote:
Here's the problem as far as I can work out

We need a URL. You have a non-trivial problem and we need to see the
whole picture.
Fair enough- but bear in mind this is work in progress...

http://gutiarinstitute.fastnet.co.uk...es/guitar.aspx

I have pages with a body with a ID and class. The ID is the page
type, in this case Sub, and with a class of the type of instrument,

In general, use class for CSS and not id. You certainly can use id, but
it tends to work better with classes (id is very "strong" in CSS
selectors, so it can get awkward to "sub-class" behaviours on a class
that's already inside an element with a matching id). You can also use
multiple classes on the same element (they go in one class attribute,
separated by spaces).
Okay. The natural quesiton would then be if the body has two classes
how do I refer to a page that has both? .sub .bass { foo:bar; }?
BUT in IE 6 the second (and third and fourth) attempt to set the
background is ignored.

Validate your code (HTML and CSS) and check that the image URLs
actually work. Chances are that it's some dumb typo you're staring
right at but haven't noticed.
Yeah - usualy is, the HTML validates, CSS appears to be okay on
validating as well.

Stew Dean

Oct 18 '06 #3

Andy Dingley wrote:
st******@gmail.com wrote:
Here's the problem as far as I can work out

We need a URL. You have a non-trivial problem and we need to see the
whole picture.
Fair enough- but bear in mind this is work in progress...

http://guitarinstitute.fastnet.co.uk...es/guitar.aspx

I have pages with a body with a ID and class. The ID is the page
type, in this case Sub, and with a class of the type of instrument,

In general, use class for CSS and not id. You certainly can use id, but
it tends to work better with classes (id is very "strong" in CSS
selectors, so it can get awkward to "sub-class" behaviours on a class
that's already inside an element with a matching id). You can also use
multiple classes on the same element (they go in one class attribute,
separated by spaces).
Okay. The natural quesiton would then be if the body has two classes
how do I refer to a page that has both? .sub .bass { foo:bar; }?
BUT in IE 6 the second (and third and fourth) attempt to set the
background is ignored.

Validate your code (HTML and CSS) and check that the image URLs
actually work. Chances are that it's some dumb typo you're staring
right at but haven't noticed.
Yeah - usualy is, the HTML validates, CSS appears to be okay on
validating as well.

Stew Dean

Oct 18 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Martin Doyle | last post by:
Ok, I'm building a JS-based limitless-sublevel dynamic menu and am making it cross browser as well - 3 packs of aspirin so far and counting ;) I'm having a weird rendering problem using Opera...
2
by: Sheila King | last post by:
I have a test/mock-up page here: http://mathxy.com/dev/index.htm and I've set one link on the dark-blue menu bar the "Home" link that comes first and it is blue font, but should not be. ...
0
by: Robert Neville | last post by:
The form elements present a major challenge in IE. Apparently, IE renders the legend element in odd way. In IE, the legend falls in the middle of the fieldset border; the background falls outside...
5
by: Peter Oliphant | last post by:
I'm drawing graphics using the Graphics object one can grab in a Form's Paint event. But I'm getting a weird thing happening... These graphic shapes flicker (even if unchanged). UNLESS- I created...
4
by: Mark | last post by:
Hi.. I changed some of my CSS, and now I get this strange problem in IE. See link: http://xailus.com/files/sample.gif. Left is firefox, what it should look like, right is IE. The footer even...
3
by: jacksoncn | last post by:
Hey everyone, I am havin a problem here, maybe someone could lend me their mind for a second. Here it is: I am using a repeat background on a y axis. When I am testing the file from my...
4
by: =?Utf-8?B?SmVzcGVyLCBEZW5tYXJr?= | last post by:
Hi, On a simple form, I have a ListBox control. This listbox control is loaded with around 800 text items of somewhat short length. There are also some other controls on the form, buttons. When...
9
prn
by: prn | last post by:
Hi folks, I've come across a couple of the oddest behaviors that I have ever seen and wondered if anyone else has had anything similar, and if so, whether you have any suggestions for me. I warn...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.