#css class priority?

1 messages · Page 1 of 1 (latest)

crystal lance
#

if i have 2 different classes applying the same property with different values what determines which value is applied? and is there some property to give priority to one class over another?
example being:

.purchase_button Label
{
    font-size: 24px;
    text-align: center;
    color: white;
    text-overflow: noclip;
}

.purchase_title
{
    font-weight: bold;
    font-size: 48px;
}

with this example my text is bolded and has 24px font, but i want it to have the 48px font from the title class

i know i can set the style in js to override it, but id rather keep the solution in xml/css

finite fern
#

The same as in CSS, classes have "weights" properties apply depending on which one is more "specific"

#

In this case .purchase_button Label will take preference

#

Regular CSS has a "hack" which is !important after a property which makes it always override, it's a terrible practice though so doesn't exist in panorama

weak vault
#

you can try changing .purchase_title to Label.purchase_title, it should have same specificity as selector above. For the same specificity selector that is later in the file should take priority afaik