>  기사  >  웹 프론트엔드  >  CSS 로그인 인터페이스 미화

CSS 로그인 인터페이스 미화

墨辰丷
墨辰丷원래의
2018-05-11 16:08:4711152검색

이 글에서는 CSS를 사용하여 웹사이트 로그인 인터페이스를 아름답게 만드는 방법을 주로 소개합니다. 필요한 친구들은 참고할 수 있습니다.

코드는 다음과 같습니다.

<html>
  <head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>美化登录</title>
      <style type="text/css">
          *{margin:0;padding:0;}/*去掉页面样式*/
          body{color:white;}
          .content{
              background-color:pink;
             position:absolute;/*绝对定位*/
             top:50%;
             left:0;
             width:100%;
             height:400px;
             margin-top:-200px;
             overflow:hidden;/*隐藏滚动条*/
         }
         .main{
             text-align:center;/*文本居中*/
             max-width:600px;
             height:400px;
             padding:100px 0px;/*上下80px,左右为0*/
             /*background:yellow;*//*验证div的位置*/
             margin:0 auto;/*设置上右下左,居中显示*/
         }
         .main h1{
             font-family:"楷体";/*设置字体*/
             font-size:70px;/*设置字体大小*/
             font-weight:2px;/*调整字体粗细*/
         }
         form{
             padding:20px 0;
         }
         form input{
             border:1px solid white;
             display:block;
             margin:0px auto 10px auto;/*上 右  下 左*/
             padding:10px;
             width:220px;
             border-radius:30px;/*H5设置圆角边框*/
             font-size:18px;
             font-weight:300;
             text-align:center;
         }
         form input:hover{
             background-color:pink;
         }
         form button{
             background-color:yellow;
             border-radius:10px;
             border:0;
             height:30px;
             width:50px;
             padding:5px 10px;
         }
         form button:hover{
             background-color:red;
         }
     </style>
 </head>
 <body>
 <div class="content">    
     <div class="main">
         <h1>Welcome</h1>
         <form>
             <input type="text" name="useid" placeholder="请输入账号"/>
             <input type="password" name="pw" placeholder="请输入密码">
             <button type="submit">登  录</button>
         </form>
     </div>
 </div>         
</body>
</html>

관련 권장 사항:

Css를 사용하여 html 양식 컨트롤(양식 미화) 세부 예

css 미화, 최적화, 병합 도구 추천_html /css_WEB -ITnose

순수한 CSS로 라디오와 checkbox_html/css_WEB-ITnose를 아름답게

위 내용은 CSS 로그인 인터페이스 미화의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.