The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Navbar Appearance 2.

2 posters

Go down

Solved Navbar Appearance 2.

Post by Ace 1 May 15th 2015, 5:50 pm

Forum Link: http://genocideclan.forumotion.com/
Forum Style: phpbb3

Yeah, I got some Navlinks to hide using this coding

Code:
a[href*="calendar"] {
  display: none !important;
}
a[href*="faq"] {
  display: none !important;
}

But when i tried to hid the original Register Page, it hid both register pages, the original (/register) and my custom html page (/h2-register).

Anyone know how to simply hide the "/register" navlink?


Last edited by Ace 1 on May 15th 2015, 6:34 pm; edited 1 time in total
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ange Tuteur May 15th 2015, 6:01 pm

Hi @Ace 1,

The problem is that you're using the wild card in the attribute selector. ( see bold red )
a[href*="register"]

This selects any anchor element that contains any occurrence of the value register. Simply remove the wild card, and place the whole pathname as the value. Example :
Code:
a[href="/register"] {
  display: none !important;
}

Note however, that the value must be exactly the same as the HREF attribute. See the following page for more information :
http://www.w3schools.com/css/css_attribute_selectors.asp
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ace 1 May 15th 2015, 6:10 pm

That worked, thanks. But when I do that, there are gaps where the navlink used to be.

Should I use the following code?

Code:
a[href="/calendar"] {
  display: none !important;
  padding: -1px;
}
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ange Tuteur May 15th 2015, 6:21 pm

Unfortunately negative padding isn't possible in CSS, however, you can use negative margins. The problem itself, doesn't come from the link, but rather the parent element; <LI>. It has about 8px of empty space, so this can be removed with the following rule.
Code:
ul.linklist li { margin:0 -4px }

It'll make your navlinks appear a bit close, so you can add some margin to them with the following rule, if you want.
Code:
#page-header a.mainmenu { margin:0 8px }
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ace 1 May 15th 2015, 6:29 pm

Just for appearance, I like the navlinks being equidistant from one another, which is satisfied by your first code. The second code (even when used with the first one) just spreads the links out more, but the space is still visible where there used to be a navlink. So the second doesn't satisfy the symmetrical aspect of my DreamForum.

-----------------------------------------------------------------------------------------------------------------

Update: Turns out, I could just go to AP > Display > Homepage > Headers and Navigation and move the hidden navlinks to either the top or bottom of the list and it doesn't show a space anymore because the navlink space (" ") is on the side of the navbar Xd

Topic Solved
Ace 1
Ace 1
Helper
Helper

Male Posts : 843
Reputation : 64
Language : English - French?
Location : Druid Hill Park

https://help.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ange Tuteur May 15th 2015, 6:45 pm

You could also do that too, thanks for providing the solution. Wink

Topic archived
Ange Tuteur
Ange Tuteur
Forumaster

Male Posts : 13207
Reputation : 3000
Language : English & 日本語
Location : Pennsylvania

https://fmdesign.forumotion.com

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum