473,700 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ 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 3740
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='v al'] 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
2110
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 = imagecreatefromjpeg($file); if($src) { $width = ImageSx($src);
7
2303
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. The only reason I know that is happening is because I keep track of the pages executed by the user to see how they have traversed the site. Has anyone every seen anything like this before? Regards, Aaron Prohaska
3
2208
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 to various parts of a table, including COL elements (though that may or may not be the cause of the problem. Both HTML and CSS pass validation. I assigned the class "project-data-attribute" to the first of two columns in
3
3065
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
1889
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 the sample document and do not pick up that the name is not unique. Any clues as to what could be going wrong? Thanks.
1
1889
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 VS2005 it gave me the error: Validation (Internet Explorer 6): Attribute 'target' is not a valid attributeof element 'frame' How can I fix this problem ? Thank you.
6
7195
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- color:lavender;} The second line is a style that is applied to a particular named COLGROUP element in tables assigned the TableStyle class. Unfortunately, while this works in most modern browsers (including
0
2131
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 Opera and Firefox but it shows problems with IE6 (I've no idea with IE7): http://www.fitcisl.it/fit/index.asp Here I copy the css code with the hope that someone knows a hack so to make it compatible with all the browsers. Thank you! Ataru
1
1768
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 Explorer Developer Toolbar utility, it showed me the id, type, and name attributes, but not the value attribute. Even if I select the "Show Read-Only Properties" option, it does not show me the value attribute. I know it is in the generated code,...
0
8729
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8648
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9217
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9078
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8974
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8928
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7815
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
3094
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 we have to send another system
2
2393
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.