Here’s the CSS code:
and the HTML code:
<div class="box box1"></div>
What do you call the two CSS classes in the div above??? (“box box1” with the space in between)
I’ve tried searching for CSS subclaseses with very little luck.
It seems to work in my Chrome and IE. Not sure if it’s safe to use across other/older browsers.
I don’t call it anything, it’s just applying two different classes to one element.
Neither is a “sub class”, that would infer that there existed some hierarchy or relationship between the two classes.
I would not worry about it, it is quite common practice to do this.
Some frameworks add several classes to a single element, though it’s not something I approve of (it smells of in-line styling in disguse).
Though there is nothing wrong with having two, maybe occasionally three classes IMO.
Opinions may vary.
it smells of in-line styling in disguse
Two would be fine. that’s what I was wondering about. Thanks
Yeah, I’m talking about:-
<div class="box1 red pos-relative float-left align-center width-50 bord-black">
Or the kind of rubbish you in Bloatstrap.
<div class="MyFancyContainer clearfix">
…is quite sensible and normal.
This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.