ASP.NET – cannot style forms

I have a problem applying CSS to <form> element and all nested elements inside. I do it by class .header_navbar_form and .header_navbar_form_input in stylesheet header.css, but only bootstrap takes effect. For some reason, other elements, such as <div>, <p>, <h1> are affected by the same stylesheet
Once again: div with id header_navbar_div is affected by the same stylesheet

cshtml:

<div id="header_navbar_div">

    <form class="header_navbar_form" action="/Home/Index">
        <input class="header_navbar_form_input" type="submit" value="Uvod">
    </form>
    <form class="header_navbar_form" action="/Home/Locations">
        <input class="header_navbar_form_input" type="submit" value="Lokality">
    </form>
     <form class="header_navbar_form" action="/Home/Trips"> 
         <input class="header_navbar_form_input" type="submit" value="Nase vandry">
    </form>
    <form class="header_navbar_form" action="/Home/Equipment">  
        <input class="header_navbar_form_input" type="submit" value="Vybava">
    </form>
    <form class="header_navbar_form" action="/Home/Recipes">  
        <input class="header_navbar_form_input" type="submit" value="Kucharka">
    </form>
    <form class="header_navbar_form" action="/Home/Tips">  
        <input class="header_navbar_form_input" type="submit" value="Navody a rady">
    </form>
    <form class="header_navbar_form" action="/Home/Nature">  
        <input class="header_navbar_form_input" type="submit" value="O Prirode">
    </form>
    <form class="header_navbar_form" action="/Home/Songbook">  
        <input class="header_navbar_form_input" type="submit" value="Zpevnik">
    </form>
    <form class="header_navbar_form" action="/Home/Partners">  
        <input class="header_navbar_form_input" type="submit" value="Partneri">
    </form>
</div>

CSS:

#header_navbar_div {
    padding-top: 2px;
    display: flex;
    justify-content: center;
}

.header_navbar_form {

    width: 50%;
    background-color: red;
}

.header_navbar_form_input {
    width: 11%;
    padding-bottom: 10px;
    padding-top: 10px;
    border-color: darkolivegreen;
    background-color: lightgoldenrodyellow;
    color: darkolivegreen;
    font-weight: bold;
}

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

I openned the application in Edge instead of Firefox and the CSS took effect, so i cleared a cache of Mozzila and it works. Kind of noobie but, solved the problem. Thanks for efforts.

Jackob


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x