When you use CSS to set the padding style for the button, the discovery does not work. Directly on the code:
The code is as follows |
Copy Code |
<! DOCTYPE html> <meta charset= "UTF-8" > <title>Document</title> <style type= "Text/css" > Body, form, UL, Li {margin:0;padding:0;} Body {height:100%;font-family: "Microsoft Ya Black", "bold"; Background-color: #298bd2;} Ul{list-style:none;} . mt-80{margin-top:80px;} . mt-30{margin-top:30px;} #userNameIn, #pwdIn, #loginBtn { Display:block; padding:25px 30px; font-size:40px; width:80%; line-height:50px; height:50px; Color: #333; Background-color: #fff; border:0 none; margin:0 Auto; } #userNameIn { border-radius:10px 10px 0 0; border-bottom:1px solid #ddd; } #pwdIn { border-radius:0 0 10px 10px; } #loginBtn { border-radius:10px; Cursor:pointer; } </style> <body> <form action= "javascript:;" method= "POST" > <ul class= "mt-80" > <li><input id= "Usernamein" type= "text" placeholder= "username"/></li> <li><input id= "Pwdin" type= "password" placeholder= "password"/></li> <li class= "mt-30" ><button id= "loginbtn" type= "button" > Login </button></li> </ul> </form> </body> |
The code effect is as shown. The login button on the page is set to the same style as the other two input boxes, but the login button is not propped up.
Original by:input[type= "button"], input[type= "Submit"], input[type= "reset"], input[type= "file"]::- Webkit-file-upload-button, button
The box-sizing properties of these elements are set by the browser defaults to Border-box;
When the box-sizing of an element is set to Border-box, its interior margins and borders are included in the width and height, which means that its width and height determine the height and width of the box.
So add a style Box-sizing:content-box to the #loginbtn, or reset it to a wide-high value. The normal effect is the following figure: