html - CSS buttons in middle "Center" -


i have tried place buttons in middle, have no idea do, i'm not best @ css.

i don't know, if i'm doing right in code, have tried place in center.

what should place buttons in middle of screen?

<style>     body {      background-image: url(http://1-background.com/images/silk/grey-silk-website-background.jpg);      }      .button {         display:block;         text-align:center;     }      h1{          text-align: center;     }     .remove{         color: red;         align-items: center;     }      .create{         color: green;         align-items: center;     }      .test{         color: blue;         align-items: center;     }  </style>  <body>     <form>         <h1>             <select id="myselect" style="width:400px" size="10"  multiple>                 <option id=" hello">hello</option>              </select>             <br />             <input type="text" name="name" value="text " style="width:350px" />         </h1>      </form>     <br>            <la class=" remove"><button onclick="myremove()" style=" align-items: center;  width: 225px"><h2 class="remove"><img id="hi" src="http://outlooksettings.com/wp-content/uploads/2014/12/remove-md.png" width="40"> remove</h2></button>     </la>      <la class="create"><button type="button" onclick="mycreate()"  style=" align-items: center; width: 225px"><h2  class="create"><img id="hi" src="https://cdn0.iconfinder.com/data/icons/large-glossy-icons/512/create.png" width="40">create</h2></button>     </la>      <la class="test"><button type="button" onclick="test()" style=" align-items: center; width: 225px"><h2 style="width:80px" class="test"><img id="hi" src="https://lh4.ggpht.com/luclbewm2mffnhc1_bbzyi5zjexazfeyf73cg2sxjfdx3_xnnhgumksrdh86tn8hqcsq7qr3va=w512" width="40">file</h2></button>     </la> 

i place them in div , apply following css div:

.my-div {   width: 100%;   text-align: center; } 

to learn more, check this out.

the result in case:

<!doctype html>  <html xmlns = "http://www.tedthespeedlearner.com"        xmlns:xsi = "http://www.w3.org/2001/xmlschema-instance"        xsi:schemalocation = "http://www.tedthespeedlearner.com     svg_red_circle.xsd">  <head>  <title>svg line</title>  <link rel = "stylesheet" type = "text/css" href = "svg_lines.css">  </link>  </head>  <style>      body {        background-image: url(http://1-background.com/images/silk/grey-silk-    website-background.jpg);        }        .button {      display:block;      text-align:center;  }        h1{           text-align: center;      }      .remove{               color: red;                align-items: center;          }         .create{              color: green;                align-items: center;          }          .test{               color: blue;                align-items: center;          }        .my-div {        width: 100%;        text-align: center;      }    </style>    <body>            <form>              <h1>                  <select id="myselect" style="width:400px" size="10"  multiple>                  <option id=" hello">hello</option>                    </select>              <br />                  <input type="text" name="name" value="text "     style="width:350px" /></h1>             </form>            <br>    <div class="my-div">        <la class=" remove"><button onclick="myremove()" style=" align-items:     center;  width: 225px"><h2 class="remove"><img id="hi"     src="http://outlooksettings.com/wp-content/uploads/2014/12/remove-md.png"     width="40"> remove</h2></button></la>        <la class="create"><button type="button" onclick="mycreate()"  style="     align-items: center; width: 225px"><h2  class="create"><img id="hi"     src="https://cdn0.iconfinder.com/data/icons/large-glossy-icons/512/create.png"     width="40">create</h2></button></la>            <la class="test"><button type="button" onclick="test()" style=" align-    items: center; width: 225px"><h2 style="width:80px" class="test"><img id="hi"     src="https://lh4.ggpht.com/luclbewm2mffnhc1_bbzyi5zjexazfeyf73cg2sxjfdx3_xnnhgu    mksrdh86tn8hqcsq7qr3va=w512" width="40">file</h2></button></la>    </div>    </body>  </html>


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -