<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>RGBizer - Your Color Code Convertor</title>
</head>
<body>
<main>
<div class="main-child">
<h1>Color Hex to RGB convertor</h1>
Enter the hexadecimal code of your favarite color in the box below to get rgb() equivalente
<form>
<label for="hex-code">#</label>
<input type="text" placeholder="Enter hex code without #" name="hex-code" id="hex-code">
<input type="submit" value="Run">
</form>
<div class="output">
<p>RGB color is <span id="rgb"></span></p>
</div>
</div>
<div class="main-child">
<p>Color preview</p>
</div>
</main>
</body>
</html>
body {
box-sizing: border-box;
margin: 0;
}
main,
.main-child {
display: flex;
}
main {
height: 47em;
}
.main-child {
flex-direction: column;
width: 50%;
height: 100%;
justify-content: center;
align-items: center;
}
.main-child:last-child {
background: green;
}
.main-child:last-child p {
color: floralwhite;
}
.output {
visibility: hidden;
}
#rgb {
font-weight: bold;
}
.main-child:first-child input[type="text"] {
width: 25em;
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.