473,573 Members | 3,290 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,

Dec 12 '09 #1
2 3732
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
2 New Member

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

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);
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...
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...
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; }
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.
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...
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....
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...
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...
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...
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. ...
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...
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...
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.