A
A
Askhat Baltabaev2016-11-30 17:57:45
Programming
Askhat Baltabaev, 2016-11-30 17:57:45

Why doesn't the height and width in the tag change?

I can't change the height and width values. Everything outside the form tag can be styled, but you don’t understand what’s going on in the tag itself.

<?
    define("DB_SERVER", "mysql.zzz.com.ua");
  define("DB_USER", "askhat");
  define("DB_PASS", "123");
  define("DB_NAME", "askhat");
?>
<?
$con = mysql_connect(DB_SERVER,DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME) or die("Cannot select DB");
error_reporting(E_ALL);
?>
<?php
error_reporting(E_ALL);
if(isset($_POST["register"]))
{
  if(!empty($_POST['name_']) && !empty($_POST['surname_']) && !empty($_POST['login_']) && !empty($_POST['password_']) && !empty($_POST['rpassword_']) && !empty($_POST['mail_'])) {
    $name = htmlspecialchars($_POST['name_']);
  $surname = htmlspecialchars($_POST['surname_']);
    $login=htmlspecialchars($_POST['login_']);
    $password=htmlspecialchars($_POST['password_']);
    $r_password=htmlspecialchars($_POST['rpassword_']);
    $e_mail=htmlspecialchars($_POST['mail_']);
        if($password == $r_password){
            switch($_POST['selectedvalue']){
            case '1':            
            $query=mysql_query("SELECT * FROM users_p WHERE login ='".$login."'");
            $query2=mysql_query("SELECT * FROM users_p WHERE e_mail ='".$e_mail."'");
            $numrows=mysql_num_rows($query);
            $numrows2 = mysql_num_rows($query2);        
           
                     if($numrows==0 && $numrows2==0){
                        $new_password = md5($password);
                        $n_password = md5($new_password);
                      $sql="INSERT INTO users_p(name, surname,login,pass,e_mail) 
                        VALUES ('$name','$surname', '$login', '$n_password','$e_mail')";
                        $result=mysql_query($sql);
                            if($result){
                            echo "<script>alert(\"Аккаунт создан успешно.\");</script>";}
                            else{
                            $message = 'Не удалось создать аккаунт.';}
                     }else{
                         if($numrows!=0){
              	       $message = 'Придумайте другой логин. Пользователь с таким логином уже существует.';}
                             else $message = 'Данная почта уже занята другим пользователем.';}
                    break;                                                                                   
            case '2':
                    $query=mysql_query("SELECT * FROM users_t WHERE login ='".$login."'");
                    $query2=mysql_query("SELECT * FROM users_t WHERE e_mail ='".$e_mail."'");
                    $numrows=mysql_num_rows($query);
                    $numrows2 = mysql_num_rows($query2);        
           
                     if($numrows==0 && $numrows2==0){ 
                        $new_password = md5($password);
                        $n_password = md5($new_password);
                      $sql="INSERT INTO users_t (name, surname,login,pass,e_mail)
                      VALUES('$name','$surname', '$login', '$n_password','$e_mail')";
                        $result=mysql_query($sql);
                            if($result){
                            echo "<script>alert(\"Аккаунт создан успешно.\");</script>";} 
                            else{
                            $message = 'Не удалось создать аккаунт.';}
                 }else{
                         if($numrows!=0){
   	                    $message = 'Придумайте другой логин. Пользователь с таким логином уже существует.';}
                        else $message = 'Данная почта уже занята другим пользователем.';}}}
                        else{
                        echo "<script>alert(\"Пароли не совпадают!\");</script>";}
         }else{
            echo "<script>alert(\"Все поля должны быть заполнены!\");</script>";}}
?>
<?php
if(!empty($message)){echo "<script>alert(\"$message\");</script>";}
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Регистрация</title>
    <link rel="stylesheet" href="css/registr.css">
    <link href="https://fonts.googleapis.com/css?family=Roboto:100,300,400,500,900&amp;subset=cyrillic-ext" rel="stylesheet">
   
</head>
<body>
   
    <div class="wrapper">
       <div class="logo_regr"></div>
        <h2>Введите свои данные ниже</h2>
        <div class="first_col">
            <span>Я </span><br>
            <span>Имя</span><br>
            <span>Фамилия</span><br>
            <span>Логин</span><br>
            <span>Пароль</span><br>
            <span>Повторите пароль</span><br>
            <span>E-mail</span><br>
        </div>
        <form action="registr.php" method="post" class="registerfrom" name="registerform">
        <select name="selectedvalue" class="teach_stud">
         <option value="1">Ученик</option>                 
         <option value="2">Учитель</option>
         </select><br>
            <p><input type="text" name="name_" class="input_name"></p>
            <p><input type="text" name="surname_" class="input_surname"></p>
         <p><input type="text" name="login_" class="input_login"></p>
          <p><input type="password" name="password_" class="input_password"></p>
           <p><input type="password" name="rpassword_" class="input_cp"></p>
           <p><input type="text" name="mail_" class="input_mail"></p>
        
        <input class="button" id="register"  name="register" type="submit" value="Зарегистрироваться"> 
        <a href="http://ozat.zzz.com.ua/" id="log_in">Войти</a>
        </form>
    </div>
     
  
</body>
</html>

body{
    background: #2D2E30;
    font-family: 'Roboto', sans-serif;
}

.wrapper{
    background: #fff;
    width: 500px;
    height: 500px;
    position: absolute;
    left: 50%;
    margin-left: -250px;
    top: 55%;
    margin-top: -250px;
    background: #eee;
}

.wrapper > h2{
    font-weight: 200;
    width: 500px;
    text-align: center;
}

.first_col, .registerfrom{
    height: 340px;
    float: left;
    line-height: 45px;
}

.first_col{
    width: 180px;
    padding-right: 10px;
    box-sizing: border-box;
}

.first_col > span{
    float: right;
    font-weight: 300;
}

.registerfrom{
     width:320px;
}

.teach_stud{
    border-radius: 3px;
    width: 150px;
    height: 25px;
}

.registerfrom > input{
    width: 250px;
    height: 20px;
    display: block;
}


.button{
    width: 300px;
    height: 40px;
    background: #478FBC;
    color: #fff;
    outline: none;
    border: 1px solid #3C7AA0;
    margin: auto;
    display: block;
}

.button[value]{
    font-weight: 300;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
}

#log_in{
    text-align: center;
    width: 500px;
    font-weight: 300;  
    font-size: 13px;
    margin-top: 10px;
    display: block;
    color: #888;
}

.logo_regr{
    width: 90px;
    height: 90px;
    background: url(../img/sample.png);
    -webkit-background-size: cover;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: -100px;
    left: 50%;
    margin-left: -60px;
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Ankhena, 2016-11-30
@askhat97

In general, height and width values ​​apply to block elements, while yours are inline.
UPD:
Replace .registerfrom > input {}with.registerfrom input {}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question