Avatar of David Schure
David Schure

asked on 

Align Text in Button

http://www.mediascrubber.com/TEST%20HEADER.html

Finally got the nav bar worked out.  Two small problems remaining.  The text on the "Join" and "Login" buttons should turn white on hover and the text itself is not centering.

<li class="nav-item"><a class="nav-link btn btn-primary" type="button"
                     href="Join-Us.html">Join</a></li>
                    <li class="nav-item"><a class="nav-link btn btn-primary" type="button"
                    href="#" data-toggle="modal" data-target="#Login">Sign In</a></li>
                

Open in new window

CSS

Avatar of undefined
Last Comment
David Schure
Avatar of David Schure
David Schure

ASKER

Halfway there.  Fixed the alignment.  rem out padding leftJust need to get the hover part.  Text turns white on hover.
#header ul.nav > li > a{
    font-size: 40px;
    font-weight: 400;
    color: #0297d7;
    padding-top: 3px;
    padding-bottom: 0;
    /*padding-left: 30px;*/
    text-transform: capitalize;
    -webkit-transition: all .5s ease;
    -o-transition: all .5s ease;
    -moz-transition: all .5s ease;
    transition: all .5s ease;
}

Open in new window

Avatar of lenamtl
lenamtl
Flag of Canada image

Hi,

the problem you have is before scrolling the background is blue then after scrolling the background is white
So you need classes base on the background as white on white or blue on blue is no good ..

so
the headr have this class name
header-continer

Open in new window

and when it is active scrolled it change to 
header-continer  active

Open in new window

so you need to edit
header-continer.active {
    background-color: rgb(255, 255, 255, 1.0);
   /// your code here ///
}

Open in new window

in style.css line 413

or create a new class
#header .active ul.nav > li > a{ 
   /// your code here ///
}

Open in new window

Avatar of David Schure
David Schure

ASKER

I have a class attached to the button already.
<li class="nav-item"><a class="nav-link btn btn-primary" type="button" href="Join-Us.html">Join</a></li>

Open in new window

I used this before and ir worked.  However since it already has a class I am trying to add this to the current class.
.btn:hover {
    background: #2196F3;
   color: white;
}

.btn .join { 
    color: dodgerblue;
}

.btn:hover .join {
    color: white;
}
.btn .log { 
    color: dodgerblue;
}

.btn:hover .log {
    color: white;
}

Open in new window

nav-button a:hover{
   /*color: #04b1fb;*/
   color:white;   
}

#header ul.nav li .nav-link.active{
   color: #04b1fb;
   /*overflow: hidden;
   float: left;*/
   display: block;
   /*color: black;*/
   text-align: center;
   padding: 14px;
   text-decoration: none;
   font-size: 20px;
   border-bottom: 3px solid transparent;
   border-bottom: 3px solid #04b1fb;
}
#header ul.nav li a:hover{
    color: #04b1fb;
}

Open in new window

but it also turns the links white.
Avatar of David Schure
David Schure

ASKER

and tried this as well....
#header .active ul.nav > li > a{ 
   color:white;
}

Open in new window

only want the two buttons "Join" and "Login" to turn white onhover.
ASKER CERTIFIED SOLUTION
Avatar of Terry Woods
Terry Woods
Flag of New Zealand image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of David Schure
David Schure

ASKER

Close... it works fine when the background is blue.  Links are the proper color on hover as well.  Buttons act as they should.  Problem is when you scroll down.  The links should be blue and the two buttons should have blue letters with a blue border.  The right combination is in this code somewhere...
 /*--------------------*/
/* HEADER */
/*--------------------*/
#header .nav-menu,#header .search-bar{
    position: fixed;
    top: 0;
    /*padding-top: 110px;*/
   padding-top: 20px;
    z-index: 99;
    width: 100%;
    height: 100%;
    background-color: #000000;
    -webkit-transform: translateX(100%);
    -moz-transform: translateX(100%);
    -ms-transform: translateX(100%);
    -o-transform: translateX(100%);
    transform: translateX(100%);
    -webkit-transition: all .5s ease;
    -o-transition: all .5s ease;
    -moz-transition: all .5s ease;
    transition: all .5s ease;
}
#header .nav-menu.active,#header .search-bar.active{
    -webkit-transform: translateX(0%);
    -moz-transform: translateX(0%);
    -ms-transform: translateX(0%);
    -o-transform: translateX(0%);
    transform: translateX(0%);
}
.nav-menu .section{
    z-index: 991;
}
#header .nav > li:first-child a{
    padding-top: 0px;
}
#header .nav{
    font-family: 'Open Sans';
    height: -webkit-fit-content;
    height: -moz-fit-content;
    height: fit-content;
    position: absolute;
    top: 110px;
    bottom: 0;
    margin: auto;
    float: none;
    left: 0;
    right: 0;
}
#header .nav > li{
    position:relative;
    width:206px;
}
#header ul.nav > li > a{
    font-size: 40px;
    font-weight: 400;
   color: #0297d7;
    padding-top: 3px;
    padding-bottom: 0;
    /*padding-left: 30px;*/
    text-transform: capitalize;
    -webkit-transition: all .5s ease;
    -o-transition: all .5s ease;
    -moz-transition: all .5s ease;
    transition: all .5s ease;
}

nav-button {
   border:solid;
   color: #ffffff;
   /*overflow: hidden;
   float: left;*/
   display: block;
   /*color: black;*/
   text-align: center;
   padding: 14px;
   text-decoration:none;
   font-size: 20px;
   /*border-bottom: 3px solid transparent;
   border-bottom: 3px solid #04b1fb;*/
   }
nav-button a:hover{
   /*color: #04b1fb;*/
   color:white;   
}

#header .active ul.nav > li > a{ 
   color:#04b1fb;
}

#header ul.nav li:nth-last-child(1) a:hover,
#header ul.nav li:nth-last-child(2) a:hover {
  color: white;
}

#header ul.nav li .nav-link.active{
   color: #04b1fb;
   /*overflow: hidden;
   float: left;*/
   display: block;
   /*color: black;*/
   text-align: center;
   padding: 14px;
   text-decoration: none;
   font-size: 20px;
   border-bottom: 3px solid transparent;
   border-bottom: 3px solid #04b1fb;
}
#header ul.nav li a:hover{
    color: #04b1fb;
}

#header .nav > li ul.child-item{
    width: -webkit-max-content;
    width: -moz-max-content;
    width: max-content;
    display:none;
    position: absolute;
    left: 200px;
    top: 20%;
    padding: 15px 25px 15px 25px;
    background-color: rgb(28, 28, 28);
}
#header .nav > li ul.child-item:after {
    content: '';
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-right: 20px solid #1c1c1c;
    border-bottom: 10px solid transparent;
    position: absolute;
    top: 10px;
    left: -17px;
}
#header .nav > li:hover ul.child-item{
    display:block;
}
#header .nav > li ul.child-item > li a{
    font-size: 24px;
    font-weight: 300;
    color: #828282;
    padding: 0;
    line-height: 32px;
    text-transform: capitalize;
}
#header .nav > li ul.child-item > li a:hover{
    color:#000000;
}

Open in new window

Avatar of David Schure
David Schure

ASKER

This fixed it.  Working perfectly.
nav-button a:hover{
   color: #04b1fb;   
}

Open in new window

CSS
CSS

Cascading Style Sheets (CSS) is a language used for describing the look and formatting of a document written in a markup language. Usually used to change web pages and user interfaces written in HTML, it can also be applied to any kind of XML document. CSS is designed primarily to distinguish the content of a document from its presentation.

43K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo