Iswar
Iswar

Reputation: 2301

how to deal with suffix and prefix in css

I am trying design a css for a dynamically generated Label. I am trying to write css for For attribute of label which can have the anything+Textbox. My prefix can be anything and suffix remain same. and I tried this

     label[for=*+"TextBox"]
    {
        color:#DD4B39;
         font-size:smaller;
    }

How to write css for above situation? Any help are surely appretiated.

Upvotes: 1

Views: 3255

Answers (3)

Xerif917
Xerif917

Reputation: 132

Try doing something like this:

label[for$="TextBox"]
{
    ...
}

More info at link

Upvotes: 2

imbondbaby
imbondbaby

Reputation: 6411

CSS selector

This will select every <label> element whose for attribute value contains "TextBox"

label[for*="TextBox"]{
    color:#DD4B39;
    font-size:smaller;
}

This will select every <label> element whose for attribute value ends with "TextBox"

label[for$="TextBox"]{
    color:#DD4B39;
    font-size:smaller;
}

Upvotes: 3

Maulik Anand
Maulik Anand

Reputation: 1449

css Selector

label[for$="TextBox"]
    {
        color:#DD4B39;
         font-size:smaller;
    }

Upvotes: 3

Related Questions