Solved

Bootstrap change nav font color

Posted on 2014-09-30
10
678 Views
Last Modified: 2014-09-30
Hi, I have this page: codedivasites.com/new/

I want to change the nav font color for about, services, etc to black, with a white hover, like the HOME.

I have custom CSS of:
a.navbar-custom:link {
    color: #000;
}


a.navbar-custom:visited {
    color: #000;
}


a.navbar-custom:hover {
    color: #FFF;
}


a.navbar-custom:active {
    color: #FFF;
}

And in the html I have:
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-custom">
                    <li>
                        <a href="about.html">About</a>
                    </li>
                    <li>
                        <a href="services.html">Services</a>
                    </li>
                    <li>
                        <a href="portfolio.html">Portfolio</a>
                    </li>
                    <li>
                        <a href="contact.html">Contact</a>
                    </li>
                </ul>

I'm not sure where I'm going wrong. Thanks for your help.
0
Comment
Question by:mel200
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
10 Comments
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40352339
You do not have any a tags with the class navbar-custom.

I think what you want is: .navbar-custom a:link etc

Cd&
0
 

Author Comment

by:mel200
ID: 40352346
Argh. Thanks.
0
 

Author Comment

by:mel200
ID: 40352364
ok, changed it to this,  but still not working on my browser. (Using red so it's easier to see when it's done, will change that later):

 .navbar-custom a:link {
    color: #ff000;
}


.navbar-custom:a.visited {
    color: #ff000;
}


.navbar-custom:a.hover {
    color: #FFF;
}


.navbar-custom:a.active {
    color: #FFF;
}
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 10

Accepted Solution

by:
jtwcs earned 500 total points
ID: 40352395
The last three of your declarations above are still not correct as you have the : in the wrong place.  They should be like the a:link one.

The below styles are more specific and should be what you are looking for.
#bs-example-navbar-collapse-1 .navbar-custom a:link, #bs-example-navbar-collapse-1 .navbar-custom a:visited {
    color: #000000;
    font-size: 18px;
}
#bs-example-navbar-collapse-1 .navbar-custom a:hover, #bs-example-navbar-collapse-1 .navbar-custom a:active {
    color: #FFFFFF;
}

Open in new window

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40352563
Yeah the typo screws up the declarations.  If it still isn't working you will need to post a link so I can see how the bootstrap bloat is interfering with what would be a ten second change in a normal stylesheet.

Cd&
0
 

Author Comment

by:mel200
ID: 40352819
ah, sorry about that. It's fixed, but still not working. You can see the html at: codedivasites.com/new/index.html and the css at
codedivasites.com/new/css/main.css and codedivasites.com/new/css/bootstrap.css and codedivasites.com/new/css/bootstrap.min.css.

Thanks.
0
 
LVL 10

Expert Comment

by:jtwcs
ID: 40352840
Did you try the declarations that I posted earlier?  They are more specific and will override the other bootstrap declarations.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40352857
The font color is coming from the declaration:  .navbar-inverse .navbar-nav > li > a {

In bootstrap.min.css

So you have to go into the bootstrap junk and do the change that would have taken seconds to locate and change if you were using your own styling instead of the third party junk.

Cd&
0
 

Author Closing Comment

by:mel200
ID: 40352866
I apologize, I somehow skimmed over that. It works, thanks so much!
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 40352871
>>>Did you try the declarations that I posted earlier?  They are more specific and will override the other bootstrap declarations.

Why would you want to hack it by adding more bloated to already bloated collection of junk declarations, and cripple the cascade even more than it is by binding the content and presentation which is exactly opposite of how CSS is supposed to be used?

Cd&
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Color can increase conversions, create feelings of warmth or even incite people to get behind a cause. If you want your website to really impact site visitors, then it is vital to consider the impact color has on them.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question