Skip to content

Web Technology Program 9

9. Divide a web page vertically and display logo of your college in left pane and logo of university in right pane

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
  font-family: Arial;
  color: white;
}

.split {
  height: 100%;
  width: 50%;
  position: fixed;
  z-index: 1;
  top: 0;
  overflow-x: hidden;
  padding-top: 20px;
}
.left {
  left: 0;
  background-color: darkgreen;
}
.right {
  right: 0;
  background-color: red;
}
.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.centered img {
  width: 150px;
  border-radius: 50%;
}
</style>
</head>
<body>
<div class="split left">
<div class="centered">
<img src="/website/img/gnimt.jpg" alt="Avatar woman">
<h2>GURU NANAK INSTITUDE OF MANAGEMNET AND TECHNOLOGY</h2>
<p>LUDHIANA</p>
</div>
</div>
<div class="split right">
<div class="centered">
<img src="/website/img/ptu.png" alt="Avatar man">
<h2>I.K. GUJRAL PUNJAB TECHNICAL UNIVERSITY</h2>
<p>JALANDHAR.</p>
</div>
</div>
</body>
</html><!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
  font-family: Arial;
  color: white;
}
.split {
  height: 100%;
  width: 50%;
  position: fixed;
  z-index: 1;
  top: 0;
  overflow-x: hidden;
  padding-top: 20px;
}
.left {
  left: 0;
  background-color: darkgreen;
}
.right {
  right: 0;
  background-color: red;
}
.centered {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}
.centered img {
  width: 150px;
  border-radius: 50%;
}
</style>
</head>
<body>
<div class="split left">
<div class="centered">
<img src="/website/img/gnimt.jpg" >
<h2>GURU NANAK INSTITUDE OF MANAGEMNET AND TECHNOLOGY</h2>
<p>LUDHIANA</p>
</div>
</div>
<div class="split right">
<div class="centered">
<img src="/website/img/ptu.png" >
<h2>I.K. GUJRAL PUNJAB TECHNICAL UNIVERSITY</h2>
<p>JALANDHAR.</p>
</div>
</div>
</body>
</html>

Output