Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2020-04-29 14:30:30

macadoum
Member
From: Lyon
Registered: 2019-02-12
Posts: 27

Float right menu

Hello, this is my actual fluxbb forum :

menu

What I would like to do is put Register and Login (and Logout when logged-in) to be at the right of the line while the others stay at left.

I suppose I have to give an id=floatright then a css float:right

But I have no idea where I can give this id to navregister, navlogin and navlogout. Which html or php does i hav to change ? header.php ?

Thanks for your help.

Offline

#2 2020-04-29 16:47:20

macadoum
Member
From: Lyon
Registered: 2019-02-12
Posts: 27

Re: Float right menu

Okay, well I finally do it by myself :

truehero

If anybody want to know, I just add this in my css :

#brdmenu li:nth-child(n+4) {
	float:right;
}

Easy, but I wonder why Register and Login are now inversed...

Offline

#3 2020-04-30 21:01:40

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,724
Website

Re: Float right menu

Will that still work when logged in? The number of menu elements can differ slightly between logged in and logged out.

That said, the list elements have IDs, so you could use those to target the links, e.g. #navregister and #navlogin.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#4 2020-05-01 07:51:19

macadoum
Member
From: Lyon
Registered: 2019-02-12
Posts: 27

Re: Float right menu

Yes I changed my code to :

#navregister:nth-child(4) {
	float:right;
}

#navlogin:nth-child(5) {
	float:right;
}

#navlogout:nth-child(6) {
	float:right;
}

It's much better now. Can the code be even better ?

Offline

#5 2020-05-01 09:01:41

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,724
Website

Re: Float right menu

You can remove the ":nth-child(*)" from each selector.


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

Board footer

Powered by FluxBB