css-selectors

Will unsupported selectors for CSS work when used inside jQuery?

There are several CSS selectors that are not supported by IE6 example: > (Child selector) + (Selects an element that is a next sibling of another element.) [attr] selector :first-child Does this impact the functioning of jQuery? i.e. if you use eg : $("div > a").css("",""); Will it cause problems in IE6 or will it work...

Shorten the comma separated CSS selectors

Hi all Maybe the title of this question is ambiguous, what I really mean is: #footer_list li a:link, #footer_list li a:visited { blah balh blah } Is there a shortcut for the two elements in CSS? so the CSS selectors can be shortened ...

CSS - What is the meaning of * rules here

Hello all, I see the following rules on a webpage: * { margin: 0px; padding: 0px; border: 0px; } Based on my knowledge, the webpage wants the IE browser to reset the margin/padding/border as 0 to avoid some potential problems. If this rule is useful, why I don't see this rule shown on popular website, such as yahoo, goo...

Change color of text using css

Can the color of this text be changed as it is inputted by the user in the text box through css only.. <html> <head> </head> <input type="text" id="name1" name="name1" /> ...

minimal javascript library to add css3 selectors to internet explorer using jquery

I know already about ie7.js and ie-css3.js, but since I have jQuery in all of my pages already, I was looking for something that uses its built-in selector parser to add this functionality only. I just need to be able to use selectors in my css such as .class1 + .class2, span ~ img, img[alt^=This] ecc and have them parsed with jQuery/ap...

css selector question

hello, is there a way in css to select an element which has a subelement with given class? i want to apply a style to a <ul> list that has <li> with a particular class. thanks konstantin ...

jQuery - remove div based on parent div class

Hello, I am trying to create a jQuery script that would remove a div/s based on what the class of the parent div is, for example based on the parent div class below i.e one-column I would like remove divs sideColumn-two & sideColumn-three <div id="footer" class="one-column"> <div class="wrapper"> <div class="contentColumn">...

CSS: Importance of specifying object over generic dot?

Given <div class="foo"> <span class="bar"></span> </div> I've always defined the CSS classes as: .foo { } .bar { } Is specifying the object important, or ultimately for readability so you can quickly see which sort of element you are searching for when editing? IE: div.foo { } span.bar { } ...

use querySelectorAll to retrieve direct children

I am able to do this: <div id = "myDiv"> <div class="foo" ></div> </div> myDiv = getElementById("myDiv"); myDiv.querySelectorAll("#myDiv > .foo"); That is, I can successfully retrieve all the direct children of the myDiv element that have class .foo. The problem is, it bothers me that I must include the #myDiv in the selector, bec...

How to use non standard CSS selectors in a CSSResource

Hello, I am trying to use styles for the scrollbars in webkit. The CSS selectors look like this: ::-webkit-scrollbar-corner ::-webkit-scrollbar-track-piece:disabled and so on. When I use those in a ClientBundle as a CSSResource, the compiler is complaining about those selectors. This results in warnings during compile time, not...

What scripts are available for fixing up styling bugs & shortcomings in IE?

There are several helpful JavaScripts and .htc behaviors that patch over the holes & buggy features in Internet Explorer's rendering engine. It seems most of them have some overlapping or incomplete feature support and it's hard to decide what to use: DD_Roundies: border-radius Fetchak ie-css3: border-radius, box-shadow, text-shadow em...

CSS controlling block element spacing.

I have a <div> that is filled with varying block elements (e.g. <p>, <ul>, <ol>, <blockquote>, etc.). I'm looking to control only the spacing between those child block elements. I also want there to be no spacing between the child block elements and the top and bottom of the parent div. I've played with a few solutions. The main one bei...

Detect :first-child support

How to detect, does browser support the CSS :first-child selector? ...

Does GWT and/or SmartGWT provide an implementation of CSS selectors?

I've seen GWT's getElementById, but I'm looking for something a lot more flexible/powerful. I'd prefer CSS selectors, but an XPath interface would do in a pinch. Thanks. ...

CSS question: # sign

Some css selector has # in front of it, what does that mean? ...

webrat + nokogiri + css selectors + whitespaces = Nightmare

I need to test with Cucumber/Webrat the presence of this button: <%=submit_tag 'Get it'%> But when I use this custom step: And I should see a button with a value of "Get it" that is: Then /^I should see a button with a value of "([^\"]*)"$/ do |value| response.should have_selector("form input[value=#{value}]") end I get: ...

CSS Select Images with style="float:left" possible?

Hello! Similar to selecting img[title="test"] can I somehow select images that have a style property of float set to left? I want to set left and bottom margins for them which don't apply to right floating images. Thank you. ...

CSS Selector - Target DT only when followed by DD

I am attempting to target a <dt> only when followed by <dd>. I know there is a preceding selector, however I can not find a CSS method of targeting the <dt>. I know this is possible with JavaScript, but would rather keep it to CSS Selectors if at all possible. This does not have to function in IE6 or below. ...

CSS3 get last element

How I can get the last element (hr) from the following code: <div> <div> <span class="hr"></span> </div> <div> <span class="hr"></span> </div> <div> <span class="hr"></span> <!-- I need this --> </div> </div> .hr:last-child doesn't work for this. Of course, DOM structure could be more...

Need CSS selector for first div within another div

I have something like: <div id="content> <h1>Welcome to Motor City Deli!</h1> <div style=" font-size: 1.2em; font-weight: bolder;">Sep 19, 2010</div> <div > ... </div> What is the css selector for the second div (1st div within the "content" div) such that I can set the font color of the date within that div? ...