Selectors are patterns that match against elements in a document tree. In a CSS rule, they are used to define styles for elements that match the pattern.
1
vote
1answer
24 views
Mysterious CSS Selectors in Chrome Profiles
I am running my website through the "Collect CSS Selector Profile" feature in my Chrome Developer Tools. My response time is alright with the exception of a long selector at the very top of my ...
0
votes
1answer
25 views
CSS Asterisk (*) selector inside the brackets
I know that the * selector selects all elements if used as such:
Example 1:
* {
margin: 0;
padding: 0;
}
But what does it mean when it is put like this:
*zoom: 1; or *margin-left: ...
-1
votes
2answers
49 views
Why is this element selecting itself?
I'm trying to highlight a list item immediately preceded by the item being hovered.
<ul>
<li><a href="#">link</a></li> <!-- this one should be highlighted ...
0
votes
0answers
44 views
Apply Padding to Elements with Certain Class after <h1>
I'm trying to apply padding only to elements that have a specific class (in this case, .specialInstructionsNotes) and are of the last type or only type after a header1 <h1> element.
Note: I'm ...
1
vote
2answers
27 views
nth-child() pseudo class on <a> tags
I've been creating a new header design for my site and all but one issue is resolved. For some reason, when i try using the nth-child(1) or first-child or last-child on the class navLink it applies ...
2
votes
3answers
114 views
Is it okay to use css classnames as an id for a module or widget?
I read an interesting post on using a css classname instead of the id attribute for identifying modules or widgets. The css classname could be prefixed with a hash or underscore, to indicate that the ...
0
votes
1answer
21 views
In Jsoup, how do I parse the CSS query by the attribute, instead of the data?
In Jsoup when I parse the URL http://www.singaporepools.com.sg/Lottery?page=wc_four_d with the CSS Query option, I get "Select a draw date" for my first element, with the query of <option ...
0
votes
1answer
33 views
CSS selector for SELECT html element with nothing selected
I know I used the word select a lot there... sorry.
Anyway, I am looking for a CSS Selector that I can use to identify HTML Select elements on a page that do not have a selection made yet so that I ...
1
vote
1answer
35 views
What is stricter way to match an element using cssSelecter in webdriver
I have 2 elements on my webpage
element 1 : <div class="DynarchCalendar-day DynarchCalendar-day-othermonth" dyc-type="date" unselectable="on" dyc-date="19960429">
element 2 : <div ...
8
votes
1answer
68 views
How to select the first element of n>4 elements with CSS only?
I'm playing around with nth-child selector.
Say I have grid with rows of 4 elements each and my first and last element have classes of ui-first-child and ui-last-child respectively:
<ul>
...
1
vote
2answers
50 views
Overlapping selectors in css
In my html page, I have div with id footer. Inside of that are couple of other divs, and last one of them has p-tag inside. How do I apply css style for that p?
#footer div p {
background-color: ...
0
votes
1answer
25 views
When using :before on an element it becomes the first child of said element?
I've always used :before in CSS to mean put content before the selector. I've never had any problems with this, however, I've stumbled across something that is confusing me where a selector's :before ...
0
votes
3answers
49 views
Does querySelectorAll support character period(.) in id?
Does querySelectorAll support character period(.) in id?
I mean if I append an element like below:
var div = document.createElement('div');
div.id='my.divid';
document.body.appendChild(div);
and ...
1
vote
2answers
41 views
LESS CSS - selecting a child with the same class as its parent
Just starting working with LESS today... got a question that I am trying to figure out.
Is there a way to apply a style to an LI that has the same class name as its parent UL, without knowing in ...
-1
votes
2answers
61 views
Why does :first-child:before target all elements?
I have a list of items which I am trying to add dividers to right of each using the :before psuedo element.
Unfortunately, it seems like when I use it in combination with both last-child and ...
0
votes
1answer
30 views
simple html dom only extract empty class
I'm trying to get the data that sits in the label element with an empty class, or a class that isn't disabled. Unfortunately none of the selectors I've tried, like the jQuery ":Not" selector are ...
-1
votes
1answer
31 views
Removing Content and Selector in CSS from first item
I am having selector with my CSS with the following code:-
nav { font-size:13px; }
.nav li {
display: inline-block;
line-height:18px;
}
.nav ol, ul {
margin-bottom: 5px !important;
}
...
4
votes
3answers
69 views
Style each letter of word without individually wrapping characters
I am using KK Countdown to countdown to Xmas for a site.
I have a design which I have to follow that has each letter of the day countown with a blue background and border radius.
Right now the html ...
1
vote
4answers
45 views
indenting a generated html div class with the help of css
I am writing an app with rails. I am not very familiar with css yet. Though, i am trying. And have a question, my html tags generated are
<div class="sub-product post-1">
// content goes here
...
0
votes
2answers
57 views
Why does CSS selector returns an array of elements?
I am writing very basic html and wanted to select only one element using css selector. However, the query returns one element in an array. I can access my element by indexing the array with [0] but is ...
3
votes
2answers
77 views
Target the First Visible Element After the First Active Element in CSS
Getting into some pretty gnarly CSS here. In the below scenario, I want to only match #4. This is what I have going on:
<ul class="tabMenu">
<li class="hidden">1</li>
<li ...
0
votes
1answer
64 views
What's the difference between selectors in CSS and jQuery?
I have some questions about selectors (e.g. :first-child...).
Are jQuery and CSS selectors the same in terms of syntax and usage? If not, what is the difference?
It seems the term selector only ...
6
votes
4answers
63 views
Styling 'first-line' inner elements
I'm attempting to put CSS styles on the list items in the first line of a list but it seems that neither Chrome, Firefox, nor Safari will accept the style.
ul:first-line > li {
display: ...
2
votes
2answers
29 views
apply css to ie7 selected radio button
Hi I am using the following code to design my radio buttons on the page..
input[type="radio"][disabled] +label
{
color: Aqua;
}
input[type="radio"][checked] +label
{
font-weight: ...
1
vote
3answers
44 views
In css, what is dot something followed by something without dot
For example,
.foo bar
.foo bam {
<key, values>
... ...
}
I know .foo selects the "foo" class, but what about the bar and bam? Are they descendants of "foo"? And bar, bam share the key ...
4
votes
4answers
101 views
CSS selectors. nth-child(even/odd) with class
Im trying to apply odd/even selectors to all elements in a list with the class parent.
HTML:
<ul>
<li class="parent">green</li>
<li class="parent">red</li>
...
-4
votes
2answers
64 views
Combining Pseudo-selectors in CSS?
I mean if I need, for example, selected text in a hovered link be red, could I use the following code in CSS style?
.abc:hover:selection{color:red}
and
<a href="123" ...
1
vote
2answers
39 views
CSS :not selector to target specific types of input
I want to style ALL inputs except for specific types.
For example:
input,
input:not(type='email') {
background: red;
}
The above doesn't work
So I want all inputs to have a background of red ...
2
votes
1answer
86 views
Practical use of :nth-child() and :nth-of-type() selectors
During my journey of self-teaching CSS, I came across the pseudo-selector :nth-child() (as well as its related selectors :nth-last-child() and :nth-of-type()).
I've studied it enough to understand ...
0
votes
1answer
55 views
CSS selector for a disabled and checked radio button's label
I am using C# .net
I have a situation where I have a few pre-checked and disabled radio button lists on my screen.
What I want is for checked and disabled radio buttons the text should be green and ...