The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Navbar Appearance 2.

View previous topic View next topic Go down

Solved Navbar Appearance 2.

Post by Ace 1 on 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
Forumember

Male Posts : 693
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ace 1 on 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
Forumember

Male Posts : 693
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ange Tuteur on 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
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

Post by Ace 1 on 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
Forumember

Male Posts : 693
Reputation : 38
Language : my css ready java yo scripts boi
Location : Druid Hill Park smoking indo

http://genocideclan.forumotion.com

Back to top Go down

Solved Re: Navbar Appearance 2.

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

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

Topic archived

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2683
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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