Button Center CSS

0 votes

Usual CSS centering problem, but it's not working for me because I don't know the final width in pixels.

Each button inside the div that contains the complete navigation no longer centers when there is more than one button.

.nav { margin-top: 167px; width: 1024px; height: 34px; } .nav_button { height: 34px; margin: 0 auto; margin-right: 10px; float: left; }
<div class="nav">
  <div class="nav_button">
    <div class="b_left"></div>
    <div class="b_middle">Home</div>
    <div class="b_right"></div>

  </div>
  <div class="nav_button">
    <div class="b_left"></div>
    <div class="b_middle">Contact Us</div>
    <div class="b_right"></div>

  </div>
</div>
Jul 25, 2022 in CSS by Edureka
• 13,620 points

edited 5 days ago 7 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP