Link to home
Start Free TrialLog in
Avatar of curiouswebster
curiouswebsterFlag for United States of America

asked on

Razor: What would the CSS look like?

StockLevel has three values,
stockLevelNone, stockLevelLow, stockLevelHigh

used thusly in a Razor file:

<div class="stockLevel stockLevelNone">
<span>Number Of Units In Stock: @Model.UnitsInStock</span>
</div>

Each of the three values would have a different style / color.

How do I code this in CSS?
SOLUTION
Avatar of CKY092
CKY092
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of curiouswebster

ASKER

So, the dot is optional?

<div class="stockLevel stockLevelNone">
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
What is this, then:

<div class="stockLevel stockLevelNone">
 
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
No, I see that one is CSS and the other is the HTML markup. I am just confused what these are:

<div class="stockLevel stockLevelNone">

I thought there would need to be some association between the class named "stockLevel" and the ones named ".stockLevelNone", etc.

I stil do not see it.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Are they each classes, and by appending them with a space between, adding them both in?
Is it like multiple inheritance?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I just never saw stockLevel defined, which is what confused me.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In your example, test was defined three times and each attribute supplemented the others. Right?

Why are both stockLevel and stockLevelNone used unless they also supplemented the other? Maybe I used the term multiple inheritance incorrectly.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks for sticking with me :)
No problem. Happy to help. Keeps me learning.