css-selectors

How can i make this CSS Popup work?

Hello, i am not able to find the reason why this popup won't work. He recognizes the hover above the table, but it has no effect on the popup. The weird thing is, when i include the path to the table to the .popup class he won't do anything, not even modify the span itself. I assume it has something to do with the selectors, but the pat...

CSS: styling when element has two classes

I have been looking at the w3 page on css selectors and have not found any promising leads, so I thought I would ask... Is there a way to style a single element with two classes differently than if it was one class? Example: <a class="foo">Red</a> <a class="bar">Yellow</a> <a class="foo bar">Orange</a> a.foo { color:red; } a.bar { c...

When writing semantic HTML, which is better: Scoping with <h1> to <h6> tags or scoping with id attributes and <span> tags?

I am trying to write high quality semantic HTML5. Which of the following two options are better semantically: OPTION 1: Define the styles by selecting spans using IDs: %body %header#global-header %h1 My Startup Name %h2 Home of the best offers in the Motor City %section#offers %h1 Today&apos;s Of...

Are "div > p" & "div p" same?

Hey, I've an obvious question. For code like: <div> <p>We want to format this text :)</p> </div> Some people use selector like: div > p { something } And others: div p { something } What's the difference in this case? In my opinion - none? And by the way, isn't the descendant item always a child?! What's the dif...

How to select all a pseudo-classes in CSS?

Hi, I've a button and I wanted to know if it is possible to make the css bellow shorter. .button a:link, .button a:visited, .button a:hover, .button a:active { color: #000; text-decoration: none; } I mean maybe: .button a:* { color: #000; text-decoration: none; } Maybe there isn't any shorter way, but I just wanted...

Combining two selectors in CSS3

Is there anyway to combine two selectors? such as: #div:hover:not(.class) Thanks Joel Edit: I understand this work as I wrote. However, how can I achieve a "hover" effect for a "LI" element , but exclude the hover effect when the mouse is over a certain "DIV' inside the LI? E.G. <li>Hello <div id="#no-hover">Bye</div> </l...

Efficient and inefficient CSS selectors (according to Google, PageSpeed ...)

While trying to reduce the HTML size of a web page, I've come across suggestions by Google and the PageSpeed Firefox Add-On regading efficiency of CSS selectors that (almost) made me reconsider the changes: http://code.google.com/intl/de-DE/speed/page-speed/docs/rendering.html#UseEfficientCSSSelectors Specifically, descendant selectors...

Which of these CSS selectors "cancel" each other out?

I found a neat example of Showing Hyperlink Cues with CSS. But in the CSS of the example, there are three separate styles that in my head should do mostly the same thing. Or at least, I should not have to use all of them in my opinion. But I'm not sure I get them all. Here they are: /* all A tags whose REL attribute equals pdf */ a[rel...

CSS and apply style for all controls with specific ID

Hello, let's say that I have some inputs with ID like that: ctl139_ctl00_txtValue ctl140_ctl00_txtValue ctl141_ctl00_txtValue ..... xxxxxx_ctl00_txtValue how, using CSS, apply the same style for these inputs (where ID follows the pattern: xxxx_ctl00_txtValue) I tried CSS3 as Minkiele suggessted but I've done the following: [id*="_c...

Is there an existing CSS3 selector parser for JavaScript?

Anybody know of snippet that will parse a CSS3 selector like this: "form#network_template[method='put'][action='#form_{keyname}']" to this: { tag: "form", id: "network_template", method: "put", action: "#form_{keyname}" } or this: <form id="network_template" method="put" action="#form_{keyname}"> ...

HPricot css search: How do I select the parent/ancestor of a particular element using a string selector?

I'm using HPricot's css search to identify a table within a web page. Here's a sample html snippet I'm parsing: <table height=61 width=700> <tbody> <tr> <td><font size=3pt color = 'Blue'><b><A NAME=a1>Some header text</A></b></font></td></tr> ... </tbody></table> There are lots of tables in the page. I want to find the table which co...

Extract last tagName of various Selectors

Basically I attempting to extract the last tag name of a handful of different css selectors. I have successfully implemented what I am talking about in javascript, I'm looking for a more compact way using only 1 regex expression preferably. Here is what I successfully have working. //Trim selector, remove [attr] selectors due to confl...

Comma in CSS, multiple selectors using the same CSS

Hi, I got following CSS: .Resource table.Tbl td { /* some css*/ } .Resource table.Tbl td.num { /* some css 2*/ } .Resource table.Tbl td.num span.icon { /* some css 3*/ } .Resource table.Tbl2 td { /* some css*/ } .Resource table.Tbl2 td.num { /* some css 2*/ } .Resource table.Tbl2 td.num span.icon { /* some css 3*/ } where the CSS...

SO: what does this css selector mean

When I check the css of SO code, there is one line: .btn - delete { has '-' and spaces inside it, what does this mean? I don't see this kind of selector in http://www.w3.org/TR/CSS2/selector.html ...

Any way to attach specific CSS styles to specific groups?

I have li already styled in a stylesheet. I need it to stay a specific style. It is styled without using a class, so for example .selectors{width:50px;} li{ padding:10px; } Now i have run into a problem. I am trying to style the li again, without any classes like what i have in the example code. For example .opti...

CSS selector for label using "for" attribute in IE 6,7

I have a label in my web page as label for="title" How can i style this specific label element? ...

CSS General Sibling Selector vs Header

Hi, This is a basic but tricky question about styling header with General Sibling Selector. Many people make a mistake about using it (and write books!). It seems for me useless: <h1>Title 1</h1> <p>text</p><p>text</p> <h2>Title 1.1</h2> <p>text</p><p>text</p> <h3>Title 1.1.1</h3> <p>text</p><p>text</p> <h2>Title 1.2</h2> <p>text</p><p...

CSS selector speed.

According to new article from css-tricks there is a big difference between how you select your elements because they are selected from right to left. The article can be found here. http://css-tricks.com/efficiently-rendering-css/ I am about to create a page that have different documents on the same page: My question is, how should i g...