PHP開発登録ページのCSSスタイル

まず、前のセクションの登録ページのコードを見てみましょう

<!doctype html>
<html>
<head>
 <meta charset="utf-8">
 <title>PHP中文网</title>
</head>
<body>
<form action="" method="post">
 <div class="container">
 <div class="right">
 <h2>用户注册</h2>
 <p>用 户 名:<input type="text" name="name" id="name"></p>
 <p>密  码: <input type="password" name="pwd" id="pwd"></p>
 <p>确认密码: <input type="password" name="pwdconfirm" id="pwdconfirm"></p>
 <p>验 证 码:<input type="text" name="yzm" id="yzm"></p>
 <p><button type="submit" value="注册" >立即注册</button></p>
 </div>
 </div>
</form>
</body>
</html>

上記のコードから、レイアウトに 2 つの div を使用していることがわかります。そのため、最初に 2 つの div のスタイルを設定します。CSS コードは次のとおりです

。 .container{
border-radius: 25px;
box-shadow: 0 0 20px #222;
width: 380px;
height: 400px;
margin: 0 auto;
margin-top: 2 00px;
background-color: rgba (152, 242, 242, 0.23);
}
.right {
position:relative;
left:40px;
top:20px;
}

次に、入力タグ、CSSコードを次のようにスタイルしましょう

input{
width: 180px;
height: 25px;
}

ボタンを美しく見せるために、ボタンの CSS スタイルも作成しました。以下の通り

button {
背景色: rgba(230, 228, 236, 0.93);
境界線: なし;
カラー: #110c0f;
パディング: 10px 70px;
text-align: center;
表示: inline-block;
font -size: 16px;
cursor: pointer;
margin-top: 30px;
margin-left: 50px;
}

登録ページに背景色を追加することをお勧めします

body{background-color: rgba (223, 255, 231, 0.28)
}


上記の CSS スタイルをページに追加すると、ページのコンテンツがより充実したものになります

完了 コードは次のとおりです

<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>PHP中文网</title>
    <style type="text/css">
        body{background-color: rgba(223, 255, 231, 0.28)
        }
        .container{
            border-radius: 25px;
            box-shadow: 0 0 20px #222;
            width: 380px;
            height: 400px;
            margin: 0 auto;
            margin-top: 200px;
            background-color: rgba(152, 242, 242, 0.23);
        }
        .right {
            position: relative;
            left: 40px;
            top: 20px;
        }
        input{
            width: 180px;
            height: 25px;
        }
        button{
            background-color: rgba(230, 228, 236, 0.93);
            border: none;
            color: #110c0f;
            padding: 10px 70px;
            text-align: center;
            display: inline-block;
            font-size: 16px;
            cursor: pointer;
            margin-top: 30px;
            margin-left: 50px;
        }
    </style>
</head>
<body>
<form action="" method="post">
    <div class="container">
        <div class="right">
            <h2>用户注册</h2>
            <p>用 户 名:<input type="text" name="name" id="name"></p>
            <p>密  码: <input type="password" name="pwd" id="pwd"></p>
            <p>确认密码: <input type="password" name="pwdconfirm" id="pwdconfirm"></p>
            <p>验 证 码:<input type="text" name="yzm" id="yzm">
                </p>
            <p><button type="submit" value="注册" >立即注册</button></p>
        </div>
    </div>
</form>
</body>
</html>

これにより、ページの見栄えが大幅に向上します



学び続ける
||
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PHP中文网</title> <style type="text/css"> body{background-color: rgba(223, 255, 231, 0.28) } .container{ border-radius: 25px; box-shadow: 0 0 20px #222; width: 380px; height: 400px; margin: 0 auto; margin-top: 200px; background-color: rgba(152, 242, 242, 0.23); } .right { position: relative; left: 40px; top: 20px; } input{ width: 180px; height: 25px; } button{ background-color: rgba(230, 228, 236, 0.93); border: none; color: #110c0f; padding: 10px 70px; text-align: center; display: inline-block; font-size: 16px; cursor: pointer; margin-top: 30px; margin-left: 50px; } </style> </head> <body> <form action="" method="post"> <div class="container"> <div class="right"> <h2>用户注册</h2> <p>用 户 名:<input type="text" name="name" id="name"></p> <p>密  码: <input type="password" name="pwd" id="pwd"></p> <p>确认密码: <input type="password" name="pwdconfirm" id="pwdconfirm"></p> <p>验 证 码:<input type="text" name="yzm" id="yzm"> </p> <p><button type="submit" value="注册" >立即注册</button></p> </div> </div> </form> </body> </html>
  • おすすめコース
  • コースウェアのダウンロード
現時点ではコースウェアはダウンロードできません。現在スタッフが整理中です。今後もこのコースにもっと注目してください〜
私たちについて 免責事項 Sitemap
PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!