Why can't I get my button to float right? [Solved]

Why can't I get my button to float right? [Solved]
0

#1

I am just trying to set up the basic outline of my portfolio here. I swear at one point I had the button floating to the right like I want it to, but then that stopped working and I can’t get it to float there again. I can even swear I had the exact same code that it has now and it is not working anymore to float the button to the right.


#2

try this:
html:

<body>
 <div class="container-fluid ">
  <nav class="navbar navbar-fix-top pull-right">
   <button class="navbar-btn btn-lg";>
    About
    </button>
  </nav>
 </div>
</body>

css:

div {
 Background-color: rgba(147, 159, 173, 0.5);
 display: flex;
 justify-content: flex-end;
}

by the look of your code im guessing that your very new to html / css and so I would recommend to leave flexbox for now and focus on other form of display.
good luck.


#3

If having zero knowledge whatsoever about web development only two months ago qualifies as new, then I’m new. And I work 5 night shifts per week, plus 2 lunch shifts at my part time job. So I don’t have a lot of time to study.

I think I threw in the flex display at some point towards the end of my attempts to fix the problem before giving up and making this thread.

You’ve helped me to figure it out. Thank you. However, I had to remove the flex stuff to make it work.

I still don’t understand why it didn’t work right when I tried all the possible combinations of classes for div and nav classes on my own. I must have tried this combination at some point, but it didn’t work. I can’t help feeling like I tried this exact code before, but it didn’t work when I tried it before.