Answers for "how to put a button in the center of the page html"

9

html center button

button{
    /*Change the width as much as you like, but make sure 
    margin-left and margin-right + width = 100%*/
    width:50%;
    margin-left:25%;
    margin-right:25%;
}
Posted by: Guest on April-29-2020
-1

html center button

<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8" />
      <title>Button align center</title>

      <style>
         .flex-parent {
            display: flex;
         }

         .jc-center {
            justify-content: center;
         }

         button.margin-right {
            margin-right: 20px;
         }
      </style>
   </head>
   <body>
      <div class="flex-parent jc-center">
         <button type="submit" class="green margin-right">Confirm</button>
         <button type="submit" class="magenta">Cancel</button>
      </div>
   </body>
</html>
Posted by: Guest on February-24-2021
0

centering a button

If the button is inside a div, put text align to center for the div
Posted by: Guest on October-11-2021

Code answers related to "how to put a button in the center of the page html"

Browse Popular Code Answers by Language