1
I’m making a website and I would like to have a voting system, but I didn’t want it to be with stars but with coffee cups (I got it from this site: font-awesome). But I can’t leave it to the girls, it always looks like a star.
index php.
<html lang="pt-br">
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="estilo.css">
<script src="https://use.fontawesome.com/eb2dfeaa2c.js"></script>
</head>
<body>
<h1>Avalie</h1>
<?php
if(isset($_SESSION['msg'])){
echo $_SESSION['msg']."<br><br>";
unset($_SESSION['msg']);
}
?>
<form method="POST" action="processa.php" enctype="multipart/form-data">
<div class="estrelas">
<input type="radio" id="vazio" name="estrela" value="" checked>
<label for="estrela_um" ><i class="fa fa-coffee" aria-hidden="true"></i></label>
<input type="radio" id="estrela_um" name="estrela" value="1">
<label for="estrela_dois" ><i class="fa fa-coffee" aria-hidden="true"></i></label>
<input type="radio" id="estrela_dois" name="estrela" value="2">
<label for="estrela_tres"><i class="fa fa-coffee" aria-hidden="true"></i></label>
<input type="radio" id="estrela_tres" name="estrela" value="3">
<label for="estrela_quatro"><i class="fa fa-coffee" aria-hidden="true"></i></label>
<input type="radio" id="estrela_quatro" name="estrela" value="4">
<label for="estrela_cinco"><i class="fa fa-coffee" aria-hidden="true"></i></label>
<input type="radio" id="estrela_cinco" name="estrela" value="5"><br><br>
<input type="submit" value="Cadastrar"> <label for="estrela_um" ><i class="fa fa-coffee" aria-hidden="true"></i></label>
</div>
</form>
</body>
</html>
css style.
.estrelas input[type=radio]{
display: none;
}.estrelas label i.fa:before{
content: '\f005';
color: #FC0;
}.estrelas input[type=radio]:checked ~ label i.fa:before{
color: #CCC;
}
How strange, in my computer modified for the cup, but it does not change color as it appears when I execute the code you sent me... (when I put to execute your code in the stackoverflow itself works right)
– user98493
@fer View library versions of my reply and compare them to the ones you use.
– Sam
I got it. Thank you
– user98493