d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Question About Bootstrap And Navbars
Add Reply New Topic New Poll
Member
Posts: 10,801
Joined: Apr 5 2010
Gold: 20.00
Mar 23 2017 12:37pm
here is my navbar

Code
<nav class=" navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">IT@MATC</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li><a href="index.html">Home</a></li>
<li><a href="degrees.html">Degree Listings</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>


how can i change the brownish background color to black without modifying it with css. no direct modifications from css can be made its the rule

theres default inverse, is there one for black? tryed searching almost every response had them in other colors or they changed them through css
Member
Posts: 5,297
Joined: Jul 25 2009
Gold: 4,414.10
Mar 24 2017 10:08am
So you are not allowed to change the css file?
Are you allowed to add a style tag? This is the worst practice in HTML , but it would be a solution.

Another solution would be the handle this in the JavaScript side. Also not best practice, but you can do it.

The best practice would be to do it in the css itself. That is why they exist.

Also, check out SASS(Just a different form/version of CSS). Bootstrap is going to it, finally. Thank jeebus.

This post was edited by worm425 on Mar 24 2017 10:08am
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
Mar 24 2017 12:22pm
You can't modify bootstrap css or you can't use any css?

If the latter, what kind of idiot gave you that task?

If the former, just link to another css file after bootstrap, or worst case, put everything in <style>...</style> tags in <head> section
Member
Posts: 24,772
Joined: Mar 7 2008
Gold: 15.00
Mar 25 2017 08:17am
do you mean modify background-color without modyfy the css? Just looks like impossible?
Member
Posts: 10,801
Joined: Apr 5 2010
Gold: 20.00
Mar 25 2017 11:22am
Quote (eric838 @ Mar 25 2017 09:17am)
do you mean modify background-color without modyfy the css? Just looks like impossible?


yes and to answer my problem, feeling pretty derp right now.

navbar-inverse only brings color to the navbar. removing yields the default black background lol damit.

by removing the -inverse that is. the class navbar gives it padding and all the other stuff

This post was edited by jsbb on Mar 25 2017 11:25am
Member
Posts: 20,788
Joined: Feb 8 2012
Gold: 1,630.69
Mar 26 2017 10:01pm
I don't work with bootstrap, but I would look for an other css rule that has a black background, and add any other rules that break the layout of your navbar, and modify your html accordingly.

If you are sure this is an inbuilt feature in bootstrap just read the documentation, or look at examples.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll