I am trying to neaten up some admin pages in an MVC 4.0 web project, and I'm running into some issues when applying both a class="" and a style="" to an html element. It seems that the class will override the inline styling.
CSS:
.adminHeader
{
display: block;
background: #3e3e3e;
color: #fff;
}
.adminLabel
{
display: inline;
padding: 5px;
font-size: 1.25em;
font-weight: 600;
}
HTML:
<div style="width: 1000px;">
<div class="adminHeader">
<span style="width: 200px;" class="adminLabel">bleh</span>
<span style="width: 400px;" class="adminLabel">blaaaaaaaaaaah</span>
<span style="width: 150px;" class="adminLabel">blu</span>
<span style="width: 250px;" class="adminLabel">bluhh</span>
</div>
</div>
What's happening is, the style="width:x;" will not be applied unless I remove the class attribute. I know I can use multi-classing, but I don't want to have to create a million different CSS classes like .width150px, .width200px, etc.
What am I missing here?
Thanks in advance! Alex