Is there a reason why some of my nav items are underlined when active, and others are not?Can you provide some examples of why it is hard to parse XML and HTML with a regex?Make the cursor a hand when a user hovers over a list itemZend Framework layout or view lagHow to affect other elements when a div is hoveredchange underline of active nav by sectionBootstrap add active class to nav bar when nav is a PHP includeCannot display HTML stringIn CSS Flexbox, why are there no “justify-items” and “justify-self” properties?Nav Menu items Underline effectAdding active class to current page in nav with jQuery
How to say "respectively" in German when listing (enumerating) things
Airport Security - advanced check, 4th amendment breach
Why does `FindFit` fail so badly in this simple case?
PhD Length: are shorter PhD degrees (from different countries) valued differently in other counter countries where PhD Is a longer process?
Can a passenger predict that an airline or a tour operator is about to go bankrupt?
Knights and Knaves: What does C say?
Is the "spacetime" the same thing as the mathematical 4th dimension?
Where does the image of a data connector as a sharp metal spike originate from?
Short story about a potato hotel that makes its guests into potatoes throughout the night
How to protect bash function from override?
Did the Soviet army intentionally send troops (e.g. penal battalions) running over minefields?
GPLv3 forces us to make code available, but to who?
Can I bring this power bank on board the aircraft?
Why the first octet of a MAC address always end with a binary 0?
Why do Russians sometimes spell "жирный" (fatty) as "жырный"?
Drawing Maps; flat distortion
Why do popular TCP-using services have UDP as well as TCP entries in /etc/services?
Re-entering the UK after overstaying in 2008
Does the 'java' command compile Java programs?
Are there types of animals that can't make the trip to space? (physiologically)
What did the Federation give the Prophets in exchange for access to the wormhole in DS9?
Is spot metering just an EV compensation?
General method to output dd1,d2,d3...dn in AnyDice
Could Boris Johnson face criminal charges for illegally proroguing Parliament?
Is there a reason why some of my nav items are underlined when active, and others are not?
Can you provide some examples of why it is hard to parse XML and HTML with a regex?Make the cursor a hand when a user hovers over a list itemZend Framework layout or view lagHow to affect other elements when a div is hoveredchange underline of active nav by sectionBootstrap add active class to nav bar when nav is a PHP includeCannot display HTML stringIn CSS Flexbox, why are there no “justify-items” and “justify-self” properties?Nav Menu items Underline effectAdding active class to current page in nav with jQuery
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty
margin-bottom:0;
I'm working on moving some nav items around on an exiting site but am unfamiliar with php (though I assumed this would just me a css issue). The issue is that some of the nav items are underlined correctly when clicked (active) while other are not.
I've tried working with the code outside of the site but because it is also php I cant get it to render properly in the browser
#main_nav .active
text-decoration: underline!important;
<nav id="main_nav" class="nav-mobile col-md-8 col-md-pull-4 col-md-float-break">
<ul>
<li id="home_link"><a href="/<?php echo $data['lang']['language']; ?>" <?php if ($data['page_info']['disc'] == 'home') echo 'class="active"'; ?> ><?php echo $data['lang']['home_link']; ?></a></li>
<li id="started_link"><a href="/<?php echo $data['lang']['language']; ?>/get-started" <?php if ($data['page_info']['disc'] == 'get_started') echo 'class="active"'; ?> ><?php echo $data['lang']['started_link']; ?></a></li>
<li id="new_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/lease-or-purchase" <?php if ($data['page_info']['disc'] == 'lease-or-purchase') echo 'class="active"'; ?> ><?php echo $data['lang']['new_vehicle_link']; ?></a></li>
<li id="keep_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/purchase-your-vehicle" <?php if ($data['page_info']['disc'] == 'purchase-your-vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['keep_vehicle_link']; ?></a></li>
<li id="vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/turn-in-your-vehicle" <?php if ($data['page_info']['disc'] == 'turn_in_your_vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['vehicle_link']; ?></a></li>
</ul>
</nav>
php html css
add a comment
|
I'm working on moving some nav items around on an exiting site but am unfamiliar with php (though I assumed this would just me a css issue). The issue is that some of the nav items are underlined correctly when clicked (active) while other are not.
I've tried working with the code outside of the site but because it is also php I cant get it to render properly in the browser
#main_nav .active
text-decoration: underline!important;
<nav id="main_nav" class="nav-mobile col-md-8 col-md-pull-4 col-md-float-break">
<ul>
<li id="home_link"><a href="/<?php echo $data['lang']['language']; ?>" <?php if ($data['page_info']['disc'] == 'home') echo 'class="active"'; ?> ><?php echo $data['lang']['home_link']; ?></a></li>
<li id="started_link"><a href="/<?php echo $data['lang']['language']; ?>/get-started" <?php if ($data['page_info']['disc'] == 'get_started') echo 'class="active"'; ?> ><?php echo $data['lang']['started_link']; ?></a></li>
<li id="new_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/lease-or-purchase" <?php if ($data['page_info']['disc'] == 'lease-or-purchase') echo 'class="active"'; ?> ><?php echo $data['lang']['new_vehicle_link']; ?></a></li>
<li id="keep_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/purchase-your-vehicle" <?php if ($data['page_info']['disc'] == 'purchase-your-vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['keep_vehicle_link']; ?></a></li>
<li id="vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/turn-in-your-vehicle" <?php if ($data['page_info']['disc'] == 'turn_in_your_vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['vehicle_link']; ?></a></li>
</ul>
</nav>
php html css
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
all but the second and fifth
– C Davies
Mar 28 at 21:33
add a comment
|
I'm working on moving some nav items around on an exiting site but am unfamiliar with php (though I assumed this would just me a css issue). The issue is that some of the nav items are underlined correctly when clicked (active) while other are not.
I've tried working with the code outside of the site but because it is also php I cant get it to render properly in the browser
#main_nav .active
text-decoration: underline!important;
<nav id="main_nav" class="nav-mobile col-md-8 col-md-pull-4 col-md-float-break">
<ul>
<li id="home_link"><a href="/<?php echo $data['lang']['language']; ?>" <?php if ($data['page_info']['disc'] == 'home') echo 'class="active"'; ?> ><?php echo $data['lang']['home_link']; ?></a></li>
<li id="started_link"><a href="/<?php echo $data['lang']['language']; ?>/get-started" <?php if ($data['page_info']['disc'] == 'get_started') echo 'class="active"'; ?> ><?php echo $data['lang']['started_link']; ?></a></li>
<li id="new_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/lease-or-purchase" <?php if ($data['page_info']['disc'] == 'lease-or-purchase') echo 'class="active"'; ?> ><?php echo $data['lang']['new_vehicle_link']; ?></a></li>
<li id="keep_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/purchase-your-vehicle" <?php if ($data['page_info']['disc'] == 'purchase-your-vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['keep_vehicle_link']; ?></a></li>
<li id="vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/turn-in-your-vehicle" <?php if ($data['page_info']['disc'] == 'turn_in_your_vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['vehicle_link']; ?></a></li>
</ul>
</nav>
php html css
I'm working on moving some nav items around on an exiting site but am unfamiliar with php (though I assumed this would just me a css issue). The issue is that some of the nav items are underlined correctly when clicked (active) while other are not.
I've tried working with the code outside of the site but because it is also php I cant get it to render properly in the browser
#main_nav .active
text-decoration: underline!important;
<nav id="main_nav" class="nav-mobile col-md-8 col-md-pull-4 col-md-float-break">
<ul>
<li id="home_link"><a href="/<?php echo $data['lang']['language']; ?>" <?php if ($data['page_info']['disc'] == 'home') echo 'class="active"'; ?> ><?php echo $data['lang']['home_link']; ?></a></li>
<li id="started_link"><a href="/<?php echo $data['lang']['language']; ?>/get-started" <?php if ($data['page_info']['disc'] == 'get_started') echo 'class="active"'; ?> ><?php echo $data['lang']['started_link']; ?></a></li>
<li id="new_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/lease-or-purchase" <?php if ($data['page_info']['disc'] == 'lease-or-purchase') echo 'class="active"'; ?> ><?php echo $data['lang']['new_vehicle_link']; ?></a></li>
<li id="keep_vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/purchase-your-vehicle" <?php if ($data['page_info']['disc'] == 'purchase-your-vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['keep_vehicle_link']; ?></a></li>
<li id="vehicle_link"><a href="/<?php echo $data['lang']['language']; ?>/turn-in-your-vehicle" <?php if ($data['page_info']['disc'] == 'turn_in_your_vehicle') echo 'class="active"'; ?> ><?php echo $data['lang']['vehicle_link']; ?></a></li>
</ul>
</nav>
php html css
php html css
edited Mar 28 at 21:52
Rick Sibley
4555 silver badges15 bronze badges
4555 silver badges15 bronze badges
asked Mar 28 at 21:07
C DaviesC Davies
597 bronze badges
597 bronze badges
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
all but the second and fifth
– C Davies
Mar 28 at 21:33
add a comment
|
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
all but the second and fifth
– C Davies
Mar 28 at 21:33
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
all but the second and fifth
– C Davies
Mar 28 at 21:33
all but the second and fifth
– C Davies
Mar 28 at 21:33
add a comment
|
1 Answer
1
active
oldest
votes
It's because you switch from dashes to underscores.
get-started -> get_started
turn-in-your-vechicle -> turn_in_your_vehicle
These will never match, so they will never be active
add a comment
|
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406861%2fis-there-a-reason-why-some-of-my-nav-items-are-underlined-when-active-and-other%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It's because you switch from dashes to underscores.
get-started -> get_started
turn-in-your-vechicle -> turn_in_your_vehicle
These will never match, so they will never be active
add a comment
|
It's because you switch from dashes to underscores.
get-started -> get_started
turn-in-your-vechicle -> turn_in_your_vehicle
These will never match, so they will never be active
add a comment
|
It's because you switch from dashes to underscores.
get-started -> get_started
turn-in-your-vechicle -> turn_in_your_vehicle
These will never match, so they will never be active
It's because you switch from dashes to underscores.
get-started -> get_started
turn-in-your-vechicle -> turn_in_your_vehicle
These will never match, so they will never be active
answered Mar 28 at 21:43
Jennifer GoncalvesJennifer Goncalves
1,1908 silver badges21 bronze badges
1,1908 silver badges21 bronze badges
add a comment
|
add a comment
|
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406861%2fis-there-a-reason-why-some-of-my-nav-items-are-underlined-when-active-and-other%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Which ones aren't rendering properly?
– Qirel
Mar 28 at 21:12
all but the second and fifth
– C Davies
Mar 28 at 21:33