Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble Overriding Bootstrap CSS
    primarykey
    data
    text
    <p>I have searched the net for a way to override bootstraps CSS but have yet to have it work for me. I am trying to change the default <code>navbar</code> color without editing the <code>bootstrap.css</code> file.<br> I have tried putting the following in the head after loading <code>bootstrap.css</code>:</p> <pre class="lang-css prettyprint-override"><code>.navbar-inner { background-color: #006633; background-image: -mox-linear-gradient(top, #006633, #006633); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#006633), to(#006633)); background-image: -webkit-linear-gradient(top, #006633, #006633); background-image: -o-linear-gradient(top, #006633, #006633); background-image: linear-gradient(to bottom, #006633, #006633); border-color: #006633; filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff006633', endColorstr='#ff006633', GradientType=0); } </code></pre> <p>This did not work so I tried putting it in its own CSS file and then loading that stylesheet like so:</p> <p><strong>bootstrapOverload.css</strong></p> <pre class="lang-css prettyprint-override"><code>.navbar-inner { background-color: #006633; background-image: -mox-linear-gradient(top, #006633, #006633); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#006633), to(#006633)); background-image: -webkit-linear-gradient(top, #006633, #006633); background-image: -o-linear-gradient(top, #006633, #006633); background-image: linear-gradient(to bottom, #006633, #006633); border-color: #006633; filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff006633', endColorstr='#ff006633', GradientType=0); } </code></pre> <p><strong>_Layout.cshtml</strong></p> <pre><code>&lt;link rel="stylesheet" href="Content/bootstrap.css"&gt; &lt;link rel="stylesheet" href="Content/bootstrapOverload.css"&gt; </code></pre> <p>When that didn't work I tried adding a custom class to element</p> <p><strong>_Layout.cshtml</strong></p> <pre><code>&lt;div class="navbar-inner navbar-override"&gt; &lt;!-- added navbar-override --&gt; </code></pre> <p><strong>bootstrapOverload.css</strong></p> <pre class="lang-css prettyprint-override"><code>.navbar-override { background-color: #006633; background-image: -mox-linear-gradient(top, #006633, #006633); background-image: -webkit-gradient(linear, 0 0, 0 100%, from(#006633), to(#006633)); background-image: -webkit-linear-gradient(top, #006633, #006633); background-image: -o-linear-gradient(top, #006633, #006633); background-image: linear-gradient(to bottom, #006633, #006633); border-color: #006633; filter: progid:dximagetransform.microsoft.gradient(startColorstr='#ff006633', endColorstr='#ff006633', GradientType=0); } </code></pre> <p>Am I doing something wrong? I would really love to learn how to do this the right way if possible.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload