473,480 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Strange CSS Attribute Selector/Internet Explorer Problem

2 New Member
First and foremost, thank you in advance for any attempts to help me out.

I am working on a project with work, and it requires I use CSS selectors to locate elements within a webpage. For the most part, I have had no issues using the selectors, but I am having a very strange issue which does not seem to make much sense to me. Please advise if you have any input at all.

Note, I am keeping this description at a high level for now because I believe the issue rests with the way I am using the selectors themselves and not with where they are being used (I will elaborate if and whenever necessary). Also, I have only tested on IE8 so my examples are limited to that.

The particular issue I am having is with the CSS Attribute Selectors, and it is as follows:

This is the HTML element I am attempting to locate:

Expand|Select|Wrap|Line Numbers
  1. <div id="ext-gen143" class="x-layer x-combo-list " style="position: absolute; z-index: 11000; visibility: visible; left: 367px; top: 317px; width: 140px; height: 76px; font-size: 11px;">
Now, the ideal selector for my purposes is one of the following:

Expand|Select|Wrap|Line Numbers
  1. div.x-combo-list[style~='visible;']
  2. div.x-combo-list[style~='visibility: visible;']
Both of which work perfectly fine in Firefox and Safari, but do not find a match in Internet Explorer (8).

In attempts to find a solution, I experimented with various combinations, and found some very strange results (this is just a subset of the combinations I tried, which I think exemplifies the scenario):

Expand|Select|Wrap|Line Numbers
  1. div.x-combo-list
  2. div.x-combo-list[class~='x-combo-list']
  3. div.x-combo-list[class~='x-layer']
  4. div.x-combo-list[class='x-layer x-combo-list ']
  5. div.x-combo-list[style]
  6. input[name]
  7. input[name='FIRST_NM']
  8. input[name='FIRST_NM'][autocomplete='off']
All of the above eight selectors find matches in Internet Explorer (8), but the following (in addition to the original two above) do not find matches in IE8.

Expand|Select|Wrap|Line Numbers
  1. div.x-combo-list[style|='z']
  2. div[class~='x-combo-list'][style~='visible;']
  3. div[class~='x-combo-list'][style~='visibility: visible;']
What this seems to tell me, for some reason, is that it appears Internet Explorer (8) can match the "style" attribute with the basic Attribute Selector, but it cannot seem to match anything using any Value Selectors for the "style" attribute, but it CAN match with Value Selectors for the "class" (or other non-style) attribute(s).

I am not sure if my explanation will suffice, but I think I have showed the issue that I have, so any input whatsoever anyone might have would be greatly appreciated!

Thanks again,

scdowney.
Dec 12 '09 #1
2 3726
drhowarddrfine
7,435 Recognized Expert Expert
Remove the semicolons. They don't belong in your examples.

While its CSS2.1 support is good, your problem may lie in its DOM implementation which is 12 years behind all other browsers. I won't have time to look into this for a couple days.
I have only tested on IE8 so my examples are limited to that.
Never, ever do that. Always use a modern browser when you are testing markup.
Dec 12 '09 #2
scdowney
2 New Member
Drhowarddrfine,

Thanks for your response. I have actually tried multiple combinations, including no semi-colons (as well as single/double/no quotes around the values), none of which had any success in IE.

Just to clarify, I have tested in FF, Chrome, Safari, and IE, I just have not yet had a chance to try previous versions of IE is all.

I fear it may indeed be a DOM implementation issue, because the selectors I am trying to use are indeed 2.1 not 3 (except for the =* which was just a stab at a solution), and the strange bit is the fact that I can successfully target elements using [class~='val'], [name~='val'], [autocomplete='val'] etc, and even [style] by itself, but AS SOON as I try to add an = or a ~= to the [style] it no longer works, but ONLY with the style attribute. That seems very strange to me.
Dec 12 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2101
by: Spoofed Existence | last post by:
Ok, I have a very weird problem here. I want to use .php to create thumbnails. For this, I use the following code: <? $file = isset($_GET) ? $_GET : exit; //Load the image $src =...
7
2293
by: Aaron Prohaska | last post by:
I have just run into a problem where I have a page that posts back to itself to execute code, except when the page does the post back it somehow executes code that is in our home page for the site....
3
2199
by: Harlan Messinger | last post by:
I've put a sample web page at http://gavelcade.com/tests/font-styles-lost.html that illustrates strange inconsistencies both among and within browsers in a situation where I've applied styles...
3
3049
by: ckirchho | last post by:
Halo, I am trying to realize a two column layout basically like this: <html> <head> <style> leftCol { float: left; width: 15em; }
2
1864
by: smachin1000 | last post by:
Hi All, In the sample schema & document below, I'd like the attribute "name" to be unique for all function elements under function_list. The tools I'm using (XML Spy and xmllint) all validate...
1
1871
by: fiefie.niles | last post by:
I converted my VS2003 ASP.Net project to VS2005. I use frame in VS2003 with no problem like the following: <frame name="banner" scrolling="no" noresize target="contents" src="SPTop.htm"> In...
6
7175
by: _googlepost | last post by:
I have some CSS that goes something like this: table.TableStyle {font-family: "Helvetica", "Ariel"; background- color:white; border-collapse:collapse;} table.TableStyle COLGROUP { background-...
0
2107
by: atarumorooka | last post by:
Hello, yes..it must be hard to try and help someone else coding but today is a full week of sadness and stress for IE CSS rendering and I need your help. Here you have a link that looks nice with...
1
1754
by: Nathan Sokalski | last post by:
I have a page that I created with ASP.NET which contains a RadioButtonList. This obviously shows up as input tags in the generated page. When I was looking at the page with the free Internet...
0
7049
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
7092
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
6981
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5348
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4790
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4488
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
2989
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
188
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.