diegoaguilar
diegoaguilar

Reputation: 8376

Can I use identifiers in CSS3?

I want to apply some different styles to HTML elements giving them custom classes for which I will write different CSS style rules.

I'd like to do like:

<p class="padding-top-15">

And then have CSS rules where top and 15 are just identifiers.

For example I'd like my CSS to be like:

.padding-$identifier1-$identifier2 {
    padding-$identifier1: $identifier2 px;
}

Is this even possible with CSS3?

Upvotes: 0

Views: 28

Answers (1)

Jukka K. Korpela
Jukka K. Korpela

Reputation: 201588

No, you cannot. There is nothing even remotely like that in CSS.

Try asking a new question where you explain what you wish to accomplish, instead of presenting an invented syntax to solve an unspecified problem. Note that if it occurred to you use a class name like padding-top-15, you have probably misunderstood some basic ideas of CSS. Think how confusing things will be if you later decide to change the top padding of that class to a top margin of 10px.

Upvotes: 1

Related Questions