Is it bad thing if I add more than one class for one object. Let's say:
<a href="#" class="paren" class="defaul">text</a>
Don't ask me why, I just need it.
Thanks.
To specify multiple classes, separate the class names with a space, e.g. <span class="left important">. This allows you to combine several CSS classes for one HTML element.
Multiple ClassesHTML elements can belong to more than one class. To define multiple classes, separate the class names with a space, e.g. <div class="city main">. The element will be styled according to all the classes specified.
Yes, it is possible, but you can only declare the class attribute once per HTML element. Just separate the classes you want to apply by a space. If you declare the class attribute more than once, all definitions beyond the first will be ignored, so in your code .
Adding a single class name import React from 'react'; import './styles. css'; function App(){ return ( <div className="container"> <h1>Hello rock!! </h1> </div> ) } export default App; If you want to add multiple class names, you can add it to the className attribute by separating with spaces.
You can use multiple class names (a perfectly normal thing to do), but are only allowed one class attribute on your HTML element.
Do this instead:
<a href="#" class="paren defaul">text</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With