Выравнивание флажков и радио - PullRequest
0 голосов
/ 11 апреля 2020

В настоящее время я работаю над базовой c HTML страницей для начинающего программиста. Что-то не так с моим выравниванием радиокнопок и флажков. Я не понимаю, что я делаю не так. Если бы кто-то мог помочь мне с этим, я был бы очень признателен. Я хотел бы, чтобы поля и текст были в одной строке.

выравнивание радиокнопок

выравнивание флажков

HTML код выглядит следующим образом:

<div class="login-page">
  <div class="form">
    <form class="register-form">
<img src="https://i.postimg.cc/v87qwNGh/CPRO.png" alt="CPRO" align="middle" height="100" width="100">

 <input type="integer" placeholder="University ID" required=""/>
      <input type="text" class="form-control" name="first_name" placeholder="First Name" required=""/> 
      <input type="text" placeholder="Last Name"/>
 <hr>
         <div class="gender">
    <input type="radio" value="None" id="male" name="gender" checked/>
    <label for="male" class="radio" chec>Male</label>
    <input type="radio" value="None" id="female" name="gender" />
    <label for="female" class="radio">Female</label>
   </div> 
      <input type="date" placeholder="Date of Birth"/>
      <input type="password" 
  placeholder="Password" required=""/>
      <input type="text" placeholder="Email Address" required=""/>
   <p>By creating an account you agree to our <a href="#">Terms & Conditions</a>.</p>
      <button>create</button>
      <p class="message">Already registered? <a href="#">Sign In</a></p>
    </form> 
    <form class="login-form">
      <input type="text" class="form-control" name="username" placeholder="Email Address" required="" autofocus="" />
      <input type="password" class="form-control" name="password" placeholder="Password" required=""/><br>
      <label class="checkbox">
        <input type="checkbox" value="remember-me" id="rememberMe" name="rememberMe"> Remember me
      </label>
  <button class="btn btn-lg btn-primary btn-block" type="submit">Login</button>  
      <p class="message">Not registered? <a href="#">Create an account</a></p>

    </form>
  </div>
</div>

CSS:

@import url(https://fonts.googleapis.com/css?family=Roboto:300);
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, 
pre, form, fieldset, input, textarea, p, blockquote, th, td { 
  padding:50;
  margin:50;}
.login-page {
  width: 450px;
  padding: 8% 0 0;
  margin: auto;
}
.about-section {
  padding: 0px;
  text-align: center;
  background-color: #eadfbe;
  color: black;
}
p#header {
font-size:50px;
}
p#header span {
font-size:500px;
}
.form {
  position: relative;
  z-index: 1;
  background: #FFFFFF;
  max-width: 550px;
  margin: 0 auto 100px;
  padding: 70px;
  text-align: center;
  box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
}
label.radio {
    cursor: pointer;
  text-indent: 35px;
  overflow: visible;
  display: inline-block;
  position: relative;
  margin-bottom: 1px;
}

label.radio:before {
  background: #280d5a;
  content:'';
  position: absolute;
  top:1px;
  left: 0;
  width: 20px;
  height: 20px;
  border-radius: 100%;
}

label.radio:after {
    opacity: 0;
    content: '';
    position: absolute;
    width: 0.5em;
    height: 0.25em;
    background: transparent;
    top: 7.5px;
    left: 4.5px;
    border: 3px solid #ffffff;
    border-top: none;
    border-right: none;

    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    transform: rotate(-45deg);
}
.gender {
  margin-left: 30px;
  margin-bottom: 30px;
}
input[type=radio]:checked + label:after {
    opacity: 1;
   width: 10%;
   display: inline-block;
   font-size:16px;
   margin: 0;
   padding: 0;
   vertical-align: top;

}
input {
    width: 10%;
    display: inline-block;
    font-size:16px;
    margin: 0;
    padding: 0;
    vertical-align: top;
}

.form input {
  font-family: "Roboto", sans-serif;
  outline: 0;
  background: #e3e3ea;
  width: 100%;
  border: 0;
  margin: 0 0 15px;
  padding: 15px;
  box-sizing: border-box;
  font-size: 14px;
}
.form button {
  font-family: "Roboto", sans-serif;
  text-transform: uppercase;
  outline: 0;
  background: #512e9f;
  width: 100%;
  border: 0;
  padding: 15px;
  color: #FFFFFF;
  font-size: 14px;
  -webkit-transition: all 0.3 ease;
  transition: all 0.3 ease;
  cursor: pointer;
}
.form button:hover,.form button:active,.form button:focus {
  background: #331675;
}
.form .message {
  margin: 15px 0 0;
  color: #b3b3b3;
  font-size: 12px;
}
.form .message a {
  color: #512e9f;
  text-decoration: none;
}

p {
  font-size: 12px;
  width: 150px;
  display: inline-block;
  margin-left: 18px;
}

.form .register-form {
  display: none;
}
.container {
  position: relative;
  z-index: 1;
  max-width: 300px;
  margin: 0 auto;
}
input[type=radio] {
  visibility: hidden;
}
.container:before, .container:after {
  content: "";
  display: block;
  clear: both;
}
.container .info {
  margin: 50px auto;
  text-align: center;
}
.container .info h1 {
  margin: 0 0 15px;
  padding: 0;
  font-size: 36px;
  font-weight: 300;
  color: #3f237e;
}
.checkbox {
      font-weight: normal;
    }
.container .info span {
  color: #4d4d4d;
  font-size: 12px;
}
.container .info span a {
  color: #000000;
  text-decoration: none;
}
.container .info span .fa {
  color: #EF3B3A;
}
input[type=checkbox], input[type=radio] {
  vertical-align: middle;
  position: relative;
  bottom: 1px;
}

input[type=radio] { 
  bottom: 2px; 
} 
body {
  background: #76b852; /* fallback for old browsers */
  background: -webkit-linear-gradient(right, #765eac, #3f237e);
  background: -moz-linear-gradient(right, #765eac, #3f237e);
  background: -o-linear-gradient(right, #765eac, #3f237e);
  background: linear-gradient(to left, #2b0c23, #7a2c67);
  font-family: "Roboto", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;      
} 

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...