frankie
frankie

Reputation: 728

CSS style not applies for custom class

I am developping ASP.NET MVC5 SPA. I have view called _Home and Site.css that is used to manage styles of _Home. In _Home.cshtml I have custom class col-contacts. Here full _Home.cshtml code:

<div class="row">
    <div class="col-md-3">
        <div class="col-contacts">
            <input type="text" class="form-control" />
            <p>Some text on which background should be applied</p>
        </div>
    </div>
    <div class="col-md-9">
        <h2>Get more libraries</h2>
        <p>NuGet is a free Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects.</p>
        <p><a class="btn btn-default" href="http://go.microsoft.com/fwlink/?LinkId=301866">Learn more &raquo;</a></p>
    </div>
</div>

And here is code from Site.css.

body {
    padding-top: 50px;
    padding-bottom: 20px;
}

/* Set padding to keep content from hitting the edges */
.body-content {
    padding-left: 15px;
    padding-right: 15px;
}

.col-contacts {
    border-style: solid;
    border: 2px;
    border-color: #000000;
}

But css style is not applied

enter image description here

Upvotes: 1

Views: 34

Answers (1)

Martin Turjak
Martin Turjak

Reputation: 21224

You should use border-width: 2px; instead of the border: 2px; or combine all three properties under the shorthand ... like so border: #000000 solid 2px;

DEMO

Upvotes: 3

Related Questions