Technology Computer Programming Web Development

How many dashes can I use in a CSS class selector value?

3 Answers
3 answers

How many dashes can I use in a CSS class selector value?

1
Example

1. <p class="sm-am"> </p>
2. <p class="sm-am-1"> </p>
3. <p class="sm-am-g-1"> </p>

Can I use all three. I use 2 dash. Is this all three format right.
Wrote answer · 11/28/2021
Karma · 3215
1
You can use as many dashes as you feel comfortable using. It's a css class name, so it can be anything you want.
Wrote answer · 12/12/2021
Karma · 1435
0

There's no explicit limit to the number of dashes you can use in a CSS class selector value.

Wrote answer · 3/14/2025
Karma · 40

Related Questions

What's a leading front-end development framework?
Write short notes on CSS and XSL.
How do I fix the error "Argument of type 'MonoTypeOperatorFunction<RouterEvent>' is not assignable to parameter of type 'OperatorFunction<Event_2, RouterEvent>'" in Angular?
Is it possible to change the HTML tag of the string in the second column, 'td', to another HTML tag like 'span'?
How to convert आई into %E0%A4%86%E0%A4%88 and how to convert %E0%A4%86%E0%A4%88 into आई? Is there a tool for this? I want to add this for my website post URL like Wikipedia. Are there any disadvantages to doing this?
Can I add CSS in Google Tag Manager (GTM)?
How can I add a `<style>` tag in the `<body>` tag? What is the right way to add a style tag in the body tag? I want to give CSS to a particular post because I don't want to put a lot of CSS in the `<head>` tag of the template. If not, please tell me another way?