-
Notifications
You must be signed in to change notification settings - Fork 0
/
random-bg-colour.php
69 lines (60 loc) · 1.42 KB
/
random-bg-colour.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<?php
$red = random_int(0, 255);
$green = random_int(0, 255);
$blue = random_int(0, 255);
echo "
<style>
html{
background-color: rgb($red, $green, $blue);
}
</style>
"
?>
<style>
.center {
max-width: fit-content;
height: 120px;
margin: auto;
display: flex;
justify-content: center;
align-items: center;
background-color: white;
padding: 5px 12px;
border-radius: 8px;
clear: both;
}
.btn {
padding: 12px 22px;
outline: none;
border: 0.2px solid black;
color: white;
background-color: rgb(50, 168, 78);
font-size: 1.2rem;
border-radius: 8px;
font-weight: 800;
}
.btn:hover{
opacity: 0.8;
}
</style>
</head>
<body>
<div class="center">
<form action="" method="post">
<input class="btn" type="submit" value="change Background color">
</form>
<br>
</br>
</div>
<div class="copy">
<?php echo "rgb($red, $green, $blue)"?>
</div>
</body>
</html>