Untitled

 avatar
unknown
php
3 years ago
346 B
4
Indexable
<?php
$n=$_GET['n'];
if($n > 10)
{
  $class="green";
}
else
{
    $class="red";
}
?>

<html>
<head>
<style type="text/css">
.box{
    width: 100px;
    height: 100px;
}
.green
{
    background: #0f0;
}
.red
{
    background: #f00;
}
</style>
</head>
<body>
<div class="box  <?= $class ?> ">
</div>
</body>
</html>
Editor is loading...