Jump to content

[SOLVED] classes???..


galvin

Recommended Posts

If throughout my code I have a bunch of classes like name1, name2, name3, etc. etc through name50, is there a way to write the CSS just ONCE, so that it styles the same thing for all of those different classes. Essentially, I'd want something like the following where X could be any number...

 

.nameX {

 

}

 

...rather than have to do...

 

.name1 {

 

}

 

.name2 {

 

}

 

.name3 {

 

}

 

and so on. 

Link to comment
Share on other sites

you need to seporate the classes with a comma not a space. If you seporate it with a space its telling it to style a class within a class. so for what you want you could put

.name1, .name2, .name3 {
css: code here;
}

 

Or why not make it even simpler like Mchl said and give them all the same class

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.