0

I have a CSS class to show the portlet title :

.portlet-title {
    color: #FFFFFF; 
    font: bold 12px Arial, Helvetica, Geneva, sans-serif;
}

In another css file I've a class :

.lfr-grid.dragging {
    border-collapse: separate;
}

now I want to call the class .portlet-title in .lfr-grid.dragging with changing the color attribute as color: #000000

2 Answers 2

3

CSS is not about calling classes, it's about applying more or less specific styles.

Assuming a structure like this:

<div class="portlet-title">...</div>

which sometimes changes to this:

<div class="portlet-title lft-grid dragging">...</div>

you can simply apply a more specific style:

.portlet-title.lfr-grid.dragging {
    color: #000000;
}
Sign up to request clarification or add additional context in comments.

Comments

0

You can accomplish this with the following:

.lfr-grid.dragging .portlet-title {
color: #000;
}

Note that .lfr-grid.dragging will not work in IE6 as it does not support chaining of classes.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.