Kit
Kit

Reputation: 359

Why Site.css doesn't work with elements of partial view?

I'm learning ASP.NET mvc and I created a new project. From what I realized, the @RenderBody() starts by opening the index.cshtml and the _Layout.cshtml is loading the Site.css file.

The problem is that I can't edit the elements of this index.cshtml with css.

My index.cshtml:

@{
    ViewBag.Title = "Home Page";
}

<div class="card">
    <div class="card-body">
        <form>

            <div className="files">
                <h4>Select Files:</h4>

                <div className="radio-btn" >
                    <div className="radio">
                         <input type="radio" value="general" />
                    </div>
                    <div className="radio">
                        <input type="radio" value="avail" />
                    </div>
                </div>
            </div>

        </form>
    </div>
</div>

and in Site.cshtml I add this:

...
.radio-btn {
    text-align: left;
    margin: 0 0 10px 20px;
    display: flex;
    flex-direction: row;
    align-items: baseline;
}

but it doesn't work... if I change something of body it works, but something on index.cshtml doesn't change

Someone can help?

Upvotes: 0

Views: 288

Answers (1)

JamieD77
JamieD77

Reputation: 13949

try using <div class="radio-btn" >.. I'm not sure what className is used for

Upvotes: 1

Related Questions