-1
Good evening, I would like to know why when I use this css style in my "bg" class in my html it works, but when I use the HTML5 version, the background style goes completely away, I searched a lot, but I couldn’t find a solution. Follows code.
Normal HTML code:
<head>
<title>Calculadora</title>
<style>
* {
margin: 0;
padding: 0;
}
.button {
width: 50px;
height: 50px;
font-size: 25px;
margin: 2px;
cursor: pointer;
background: #607d8b;
border: none;
color: white;
}
.textview {
width: 217px;
margin: 5px;
font-size: 25px;
padding: 5px;
border: none;
color: #607d8b;
}
.main {
position: absolute;
top: 50%;
left: 50%;
transform: translateX(-50%)translateY(-50%);
}
.bg {
background: linear-gradient(to right, #e91e63, #3f51b5);
height: 100%;
}
</style>
</head>
<body>
<div class="bg"></div>
<div class="main">
<form name='form'>
<input class="textview" name="textview">
</form>
<table>
<tr>
<td> <input class="button" type="button" value="C" onclick="clean()"> </td>
<td> <input class="button" type="button" value="<" onclick="back()"> </td>
<td> <input class="button" type="button" value="/" onclick="insert('/')"> </td>
<td> <input class="button" type="button" value="x" onclick="insert('*')"> </td>
</tr>
<tr>
<td> <input class="button" type="button" value="7" onclick="insert(7)"> </td>
<td> <input class="button" type="button" value="8" onclick="insert(8)"> </td>
<td> <input class="button" type="button" value="9" onclick="insert(9)"> </td>
<td> <input class="button" type="button" value="-" onclick="insert('-')"> </td>
</tr>
<tr>
<td> <input class="button" type="button" value="4" onclick="insert(4)"> </td>
<td> <input class="button" type="button" value="5" onclick="insert(5)"> </td>
<td> <input class="button" type="button" value="6" onclick="insert(6)"> </td>
<td> <input class="button" type="button" value="+" onclick="insert('+')"> </td>
</tr>
<tr>
<td> <input class="button" type="button" value="1" onclick="insert(1)"> </td>
<td> <input class="button" type="button" value="2" onclick="insert(2)"> </td>
<td> <input class="button" type="button" value="3" onclick="insert(3)"> </td>
<td rowspan="5"> <input class="button" style="height: 106px" type="button" value="=" onclick="equal()">
</td>
</tr>
<tr>
<td colspan="2"> <input class="button" style="width: 106px;" type="button" value="0"
onclick="insert(0)"> </td>
<td> <input class="button" type="button" value="." onclick="insert('.')"> </td>
</tr>
</table>
</div>
<script src="script.js"></script>
</body>
</html>