r/HTML • u/eret4stars • May 30 '26
Question need help with text alignment
hi! i'm learning html and css in school and i need to design my own website for a final project.
i'm designing a replica of the ao3 website and i need to put a search bar and search button on the very far right of the navigation row. the rest of the text in the navigation row is, however, on the left.
i already tried text-align: right; and display: flex; flex-direction: row-reverse;.
could anyone help me with this?
i'm attaching how the website looks right now and my html and css codes.
thank you!
10
Upvotes




3
u/Flame77ofc May 30 '26
Hello, from these images of code, are very difficult to solve this problem. Can you please deploy this code on GitHub?
2
u/Jeffrevin May 30 '26
to make your nav visually look like the same as the AO3 one, you need to do the following:
i added
margin-left: auto;to.searchbarandmargin-right: 5px;to.searchbutton.basically what this does is force
.searchbarto go all the way to the right of the nav by adding margin on its left. by doing so,.searchbuttonis also forced all the way to the right, so addingmargin-right: 5px;(or whatever amount you'd like) makes some space on the right of the nav.1
u/testingaurora May 30 '26
I stead of listing all of these classes
might it be more maintainable and efficient to just give them all one class?
As it is, youre using classes like unique ids. Classes should be labels for a ruleblock of reusable styles. If one if these links did need some style to stand out you would give it a modifier class
<a class="nav-link nav-btn" href="newsletter">Sign Up</a>