virtualsets
virtualsets

Reputation: 403

Duplicate id with the same properties

I install popeye to slider images. When I must to create another slider show I duplicate all the css content to another id for example this

 #ppy1 .ppy-extcaption {
     width:          240px;
     display:        block;
}
 #ppy4 .ppy-extcaption {
     width:          240px;
      display:        block;
}
#ppy5 .ppy-extcaption {
      width:          240px;
      display:        block;
}

there are any form to create diferents id with same properties with less css code duplicate.

Thank you Sorry my bad english

Upvotes: 0

Views: 51

Answers (3)

Bhojendra Rauniyar
Bhojendra Rauniyar

Reputation: 85653

Use like this:

[id*=ppy] .ppy-extcaption{
     width: 240px;
     display: block;
}

Update

[attr^=value] Represents an element with an attribute name of attr and whose value is prefixed by "value".

[attr*=value] Represents an element with an attribute name of attr and whose value contains at least one occurrence of string "value" as substring.

source

Upvotes: 1

Curtis
Curtis

Reputation: 103428

#ppy1 .ppy-extcaption,
#ppy4 .ppy-extcaption,
#ppy5 .ppy-extcaption
{
     width:240px;
     display:block;
}

Or if you're confident class ppy-extcaption isn't used anywhere else in your application, just reference the class:

.ppy-extcaption
{
     width:240px;
     display:block;
}

Upvotes: 3

GautamD31
GautamD31

Reputation: 28773

Simply use class

.ppy-extcaption {
     width:          240px;
     display:        block;
}

Or even you can use them like

#ppy1 .ppy-extcaption, #ppy4 .ppy-extcaption, #ppy5 .ppy-extcaption
{
     width:240px;
     display:block;
}

Upvotes: 3

Related Questions