"Back to Top" CSS id causing other element to misalign

Ima Jedi
Ima Jedi used Ask the Experts™
on
I created an id for my back to top link on my WordPress site.
I styled it using css with the #backtotop selector.
Now when I click on the back to top link, my top nav links all align to the left.
Any ideas or suggestions?
<p id="tothetop"> <a href="#menu-header-menu">Back to Top</a></p>

Open in new window

#tothetop {
	text-align: right !Important;
}

Open in new window

before:Top navigation before I click on the back top top link.after: URL AFTER I click on the back top top link.Top navigation AFTER I click on the back top top link.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
Have you got a link to show us?

Also your question is confusing. You mention #BackToTop but in the code it is #tothetop

Author

Commented:
The site is not live yet.
 You are correct it is #tothetop, please disregard #BackToTop.
Commented:
It turns out that the anchor for #menu-header-menu was set to a ul in the top nav menu. Moving the anchor to another element fixed the issue.

Author

Commented:
Found solution before anyone else helped.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial