While practicing different scenarios in which CSS3 pseudo-classes and selectors might come in handy, I ran across something I just can't figure out!
Here's the situation. I want to modify the :first-of-type::first-letter of the first non-empty paragraph for a block of text. I'm not sure that pseudo-classes can be stacked though. Here's ...
This is the structure of HTML. I have to add an event listener when user click on div with className "next_button". I try to add an event listener by using prototype.
<div id="horizontal_carousel2">
<div class="previous_button"></div>
<div class="container" >
<ul>
<li></li>
<li></li>
<li></li>
<li>...
I came across Google's Page Speed add-on for Firebug yesterday. The page about using efficient CSS selectors said to not use overqualified selectors, i.e. use #foo instead of div#foo. I thought the latter would be faster but Google's saying otherwise, and who am I to go against that?
So that got me wondering if the same applied to jQuer...
I created this user style to make my StackOverflow use much more pleasant. As the screenshots there illustrate, my sidebar contains only the "Ignored Tags" header and input box. I don't care about all of the unanswered tags, nor about all of the tags I've already ignored. Here is the CSS:
#sidebar > * { display: none }
#sidebar > :nth-c...
I have been working on this and cannot get this iterator to work. I have the following HTML and am trying to iterate through all rows (except the first row) and extract the values in cells (td) 2 and 3 :
<div id="statsId">
<table width="220" cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td widt...
I have the following xpath statement in a selenium test:
//tbody/tr[td/span[text()='IPODate']]/td[4]/input
It gets what I want but my tests are painfully slow in IE6. Anyone know how I would do the same selector as CSS selectors? I think I understand how to do each of these with exception to the text()="IPODate" part.
As requested he...
Styling an element with an attribute set is easy: E[attr].
Is there any way to style an element with CSS2 based on the absence of an attribute, something like this E[!attr]? (JavaScript solution is not an option).
For example, there are several class rules followed by id rule:
.abc {padding:1em;}
.def {padding:2em;}
#n a {padding:0;}...
I have often seen stylesheets written where you have something like this:
#anyelement {
background:transparent url(../img/filename.png) no-repeat left top;
}
The value in question is the "transparent" value - what is the benefit of using this value? I have never really used it with my own css files and my PNG images still seem to wo...
I want to match a with id "breadCrumb" only if it has a child span id "userName".
Match:
<div id="breadCrumb" class="nav">
<span id="userName">esac</span>
</div>
But not match:
<div id="breadCrumb" class="nav">
<span id="navtrail">...</span>
</div>
I want to set #breadCrumb { display: none; }, but I don't want to hide it ...
I've the following html:
<li><a href="/stumbler/millisami/tag/company/" class="">
<span class="right">69</span>
company</a>
</li>
and I want to scrap the text after the span tag, i.e. "company"
So, when I tried
doc.at_css("span:after")
the no method error :after is thrown.
How to use pseudo selectors with Nokogiri??
...
$('.table tbody td:eq(3)').addClass('col4');
..works, but only selects the first cell, not all cells in the column.
...
hello.
I'm having troubles running an onchange event on a somewhat deeply nested form pulldown.
So basically I have a form with an id of maxResultsForm inside a table with an id of listProductsResults inside another table with an id of listProductsSettings... with an id on the select tag of maxResults
I've tried the below selector an...
I want to select the values of attributes of an element. For e.g if I have an input element
<input type="text" name=myInput value="100">
I can locate it using input[name='myInput'], but how do I get the value of it using a css selector?
BTW, I am trying to do this in Selenium using css selectors
...
Isn't the "a:link" pseudoclass redundant with "a" when put in that order (:link, :visited, :hover, :active)? Why put this:
a:link {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: yellow;}
When you could just put this:
a {color: blue;}
a:visited {color: purple;}
a:hover {color: red;}
a:active {color: ye...
How to give style to list item only if item has another list inside otherwise style should not apply? using css only.
See example here http://jsbin.com/udora
I want to remove arrows from all other items except "Articles" and "Pitching Past the 7th Inning"
I realized it's not possible with css any working jquery solution with demo?
...
i want to use an event of an anchor element in some nested div's but something is not working in my code.
i tried hundreds of variations on that selector but it still does not work.
html code:
<div class="tabContents">
<div class="thumbArea">
<a href="#">
<img src="foo" alt="baba"/>
</a>
</div>
<div class="imageArea">
...
Even though I am going to use this CSS selector in Selenium, this should be generic enough.
I have a page with table of class "list" & it can occur multiple times. I want to find out each occurrence & how many rows each table has. So for this I could use table[class='list'] & will give me all the tables of that class in the page. In th...
I use MooTools, and I need to find the element which has both classes "a" and "b" (the innermost div in my example below).
The HTML structure is:
<div class="a">
<div class="otherclass">
<div class="b"></div>
</div>
</div>
In jQuery it's $("div .a .b"), as far as I know. What's the mootools syntax? I've tried
$$("div ....
I downloaded a framework and they are using this as a css selector:
"#Footer .footerTop"
Why not just use:
".footerTop"
Are they the same, or selection is different?
...
Is there a way in CSS to select the label fields which are bound to input fields (via the for attribute) having the required attribute set?
Something like -- label:input[required]
Currently, I'm adding class=required to labels and inputs for styling. I now have the HTML5 attribute required="required" in the required input fields. Wou...