How to create correct .css for Html.TextBoxFor


Tags: html,css,asp.net-mvc

Problem :

In my views, I need to have a textboxs with propher style.

For example:

@Html.TextBoxFor(m => m.Number, new {disabled = "disabled", @class = "special-container"})

And in .css:

.special-container
{
    background: -webkit-linear-gradient(#ffffff, #656565 50%);
    background: -o-linear-gradient(#ffffff, #656565 50%);
    background: -moz-linear-gradient(#ffffff, #656565 50%);
    background: linear-gradient(#ffffff, #656565 50%);
    border-left:1px solid #000000;
    border-right:1px solid #000000;
    border-top:1px solid #000000;
    border-bottom:1px solid #000000;
    color: red;
    width:90%;
    font-size: 12px;
    font-weight: 600;
}

Half of it are working. I mean, border and backgroud are working as it supposed to work, BUT color, font and width gets totally ignored and I can't figure out why. If I add, for example, color as atribute or anything that was ignored:

Style = "color:red"

It's working as it should.

So, my question is, what am I doing wrong if style in .css are ignoring half of properties, but they still works as atributes? How it supposed to look?

P.S Sorry for my bad english.



Solution :

I think there is something which is overriding your CSS. Please double check on this.


    CSS Howto..

    How to increase the distance between table columns in html?

    How to stretch segment of image in html/css

    How do I constraint an animation using only CSS and HTML?

    Show/Hide Markers that are pulled from function

    How to give reference to static resources like css,images,java script in JSP?

    How to make sticky navigation change colour when scrolling past a certain div?

    How to use CSS in Emails (specifically, to design hyperlink button)

    Yahoo news CSS, how to achieve behavior

    How do I center these three blocks horizontally?

    How to add font awesome in CSS

    How to access the physical Bundled and Minified js / css created by BundleConfig class

    How to make video thumbnails like Facebook [CSS]

    How to modify multiple CSS attributes of an element?

    Why IE10 shows something totally different

    How to apply a underline style to piece of text

    How to make video responsive for all the screen sizes?

    How to set alternate row color for a given attached diagram

    How to make the whole div clickable

    HTML/CSS How to make a menu closed and then use class=“active”

    How to zoom in / out depending on browser height, using CSS zoom property? [closed]

    How to preserve styles of embedded widget?

    Clickable dropdowns - How do they work?

    How to remove a element after animation?

    CSS : how to center a input inside a div

    Google Maps visual refresh - how do disable font Roboto in InfoWindow

    How do I get a div to fit to the screen with no overflow in CSS

    How to use a CSS :first-letter pseudo-element in a
    paragraph

    How can a html table highlight columns by changing the border on hover?

    Jquery how to get specific css values from css properties with stacked value options such as font-family

    How to draw a shape using a piece of image in php