提示画像ですが<div>で画面の中央に持ってきてそれでいて入力欄を揃えたのですが参考サイト通りにやっても実行できませんどうやって
横並びで端を揃えられるのでしょうか?
参考サイト: https://developer.mozilla.org/ja/docs/Web/HTML/Element/label
php
1<!DOCTYPE html> 2<html lang=ja> 3 <head> 4 <meta charset="utf-8"> 5 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> 6 <link rel="stylesheet" href="style.css"> 7 <title>ログイン</title> 8 </head> 9 10<body> 11 12<?php 13session_cache_limiter('none'); 14ini_set("display_errors",1); 15error_reporting(E_ALL); 16 17Require_once "login_db.php"; 18?> 19 20 21<h1 class="center"> ログイン <h1> 22 23<?php 24if( (isset($_POST["submit"]) == false) && (isset($_SESSION["login"]) == false) ) 25{ 26?> 27 28 <div class="center"> 29 <form action="login.php" method="post"> 30 31 <label>メールアドレス<input type="text" name="mail"></label> 32 <label>ID<input type="text" name="id"></label> 33 <label>パスワード<input type="password" name="password"><label> 34 <button type="submit" name="submit"> ログイン </button> 35 </form> 36 </div> 37 38 <br><br><br><br><br> 39 <div class="center"> 40 <form action="signup.php" method="post"> 41 <button> 登録 </button> 42 </form> 43 </div> 44 45 46 47 48 49<?php 50} 51?> 52 53<?php 54if( (isset($_POST["submit"]) == true) && (isset($_SESSION["login"]) == false) ) 55{ 56 if(SetAccountLogin_OK($_POST["mail"],$_POST["password"],$_POST["id"]) == true) 57 { 58 /* ログイン */ 59 $account = GetAccount($_POST["mail"]); 60 if($account != false) 61 { 62 $_SESSION["name"] = $account["name"]; 63 $_SESSION["mail"] = $account["mail"]; 64 $_SESSION["UUID"] = $account["UUID"]; 65 $_SESSION["id"] = $account["id"]; 66 $_SESSION["login"] = true; 67 68 header("Location:https://shigure-chan.com/index.php"); //トップページに戻る 69 70 } 71 else 72 { 73 print("ERROR アカウントがありません"); 74 } 75?> 76<?php 77 } 78 else 79 { 80?> 81 <div class="center"> 82 <h1>パスワードまたはIDまたはメールアドレスが間違えています</h1> 83 </div> 84<?php 85 } 86} 87?> 88 89 90 91 92</body> 93</html> 94
css
1@media screen and (min-width: 641px) 2 { 3 4 /* 中央揃え */ 5 .center 6 { 7 8 text-align: center; 9 font-size: 20px; 10 11 } 12 13 label{ 14 display: inline-block; 15 text-align: right; 16 width: 150px; 17 } 18 19 .pc_markdown 20 { 21 22 23 color: #C0C0C0; 24 text-align: center; 25 font-size: 20px; 26 27 } 28}
>参考サイト通りに
どこがどう参考サイト通りなのか分からないですけど、
自分が組んでるのだから他人のせいにするのをやめられるところから始めてください。
悪いのは参考サイトではないです。理解してなくて自分が思った通りに動くと思っているあなたです。
回答2件
あなたの回答
tips
プレビュー