1
The CSS is working with the button inside the else
but it does not work with the button located inside the if
. The button inside the if refers to the page with the logged in user and the else
with the user loaned that is normally loading the guidelines made in the file . css, I would just like to know why it appears that he " does not read the button
within the if
"
?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<header>
<nav>
<div class="main-wrapper">
<ul>
<li>
<a href="index.php">Home</a>
</li>
</ul>
<div class="nav-login">
<?php
if (isset($_SESSION['u_id'])) {
echo '<form action="includes/logout.inc.php" method="POST">
<button type="submit" name="submit">Deslogar</button>
</form>';
}else{
echo '<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<form action="includes/login.inc.php" method="POST">
<input type="text" name="uid" placeholder="Apelido/e-mail">
<input type="password" name="pwd" placeholder="Senha">
<button type="submit" name="submit">Entre</button>
</form>
<a href="singup.php">Cadastre-se</a>';
}
?>
</div>
</div>
</nav>
</header>
Input and button CSS
header .nav-login form input {
float: left;
width: 30%;
height: 50%;
padding: 0% 3%;
margin-right: 2%;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
line-height: 30px;
background:#fff;
border:1px solid #ccc;
border-top-color:#d9d9d9;
box-shadow:0 1px 2px rgba(0,0,0,0.2);
-moz-box-shadow:0 1px 2px rgba(0,0,0,0.2);
cursor:default;
}
header .nav-login form input:hover {
float: left;
width: 30%;
height: 50%;
padding: 0% 3%;
margin-right: 2%;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
line-height: 30px;
background:#fff;
border:1px solid #ccc;
border-top-color:#d9d9d9;
box-shadow:0 2px 4px rgba(0,0,0,0.2);
-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);
cursor:default;
}
header .nav-login form button {
float: left;
width: 17%;
height: 50%;
padding: 0% 3%;
margin-right: 5%;
font-family: 'Open Sans', sans-serif;
font-size: 14px;
color: #696969;
line-height: 30px;
background:#fff;
border:1px solid #ccc;
border-top-color:#d9d9d9;
box-shadow:0 1px 2px rgba(0,0,0,0.2);
-moz-box-shadow:0 1px 2px rgba(0,0,0,0.2);
cursor:pointer;
}
header .nav-login form button:hover {
float: left;
width: 17%;
height: 50%;
padding: 0% 3%;
margin-right: 5%;
font-size: 14px;
font-family: 'Open Sans', sans-serif;
color: #000000;
line-height: 30px;
background:#fff;
border:1px solid #ccc;
border-top-color:#d9d9d9;
box-shadow:0 2px 4px rgba(0,0,0,0.2);
-moz-box-shadow:0 2px 4px rgba(0,0,0,0.2);
cursor:pointer;
}
created class only for button and permenece problem, follow the images
Put the snippet of the css being used.
– Rodrigo de Farias
I only posted the button and input snippets I use
– Oggi Mrm
Oggi take a look at the comment I made in my answer, now that I see that you edited the question
– hugocsl