css-classes

css: Should I limit the use of universal selectors (*.classname vs a.classname)?

I have a question about css selectors. Say I have the following html <div class="message"> <div class="messageheader"> <div class='name'>A news story</div> </div> </div> In the css I could refer to the class called name either like this div.message div.messageheader div.name {} or .name {} /* ie *.name{} */ Is one way ...

How to add CSS classes to Zend_Form_Element_Select option

Hi, I'm trying to add a CSS class to a Zend_Form_Element_Select option, but I just can't find a way to do it. The desired output would be something like this: <select name="hey" id="hey"> <option value="value1" style="parent">label1</option> <option value="value2" style="sibling">sublabel1</option> <option value="value3" s...

Remove text decoration from links.

Why won't this remove the underline from the facebook and assassin industries links on this page. .module_wpproad { text-decoration:none; border:none; } ...

How do I run jQuery form validation by class?

Hi there, I've been using the jQuery form validator, but I can't seem to figure out how to trigger it by class. Take this example: $("#myform").validate({ rules: { field: { required: true, date: true } } }); Where field it is expecting the name of the particular input. But, what if I have the following: <inpu...

Multiple CSS Classes: Properties Overlapping based on the order defined.

Is there a rule in CSS that determines the cascading order when multiple classes are defined on an element? (class="one two" vs class="two one") Right now, there seems to be no such effect. Example: both divs are orange in color on Firefox <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt...

In CSS, is ".class1.class2" legal and common usage?

I am quite used to seeing div.class1 and #someId.class1 but what about .class1.class2 ? And I think it is identical to .class2.class1 ? Because there was an element with id someId but now we have two elements of this type showing on the page, so I want to add a class and use the class instead of id, therefore the .class1.cl...

CSS - "style" property not overriding class

I have a DIV container that is a CSS class defined on the top level. That container also has a style that has a couple elements that should override the main class elements. As far as I understand, this is what it should be doing, but it seems to ignore everything I am putting in there. /* In the CSS file. */ div.ItemContainer { pos...

What is the right way to use more than 1 CSS class on an element?

I can imagine it can get complicated fast trying to debug style issues when there are multiple classes associated with elements. Currently I'm using multiple classes but in a way that one type of class is for jQuery manipulation and the other is for style. So I can have an element <div id='myDiv' class'ActionControl SearchBox'></div> w...

Check element class by jQuery

How do you check if the class that is assigned to a div? For example, I want to check if a div has a class of header-link then it should alert a message box similar to this: $('.header a').click(function() { if($(this).classname == 'header-link') { alert('the element has the class name already'); } else { ...

How do I change an elements class in jquery?

Assuming I have <ul class="myList verticalList"> how can I change the value of verticalList using jquery? ...