Oct 10th Lesson

Day: Monday

Date: October 10, 2024

Time: 10:00 AM

HTML Code


<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>
   <link href="position.css" rel="stylesheet" />
</head>
<body>
   <div class="parent">
      <div class="coverphoto">
         <img src="coverphoto_zz8brl.jpg" />
      </div>
      <div class="profilephoto">
         <img src="profilephoto_wm9zv2.jpg" />
      </div>
   </div>
</body>
</html>
            
This HTML code sets up a basic webpage structure. It includes a cover photo and a profile photo.

CSS Code


* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}
body {
    background-color: #f4f2ee;
}
.parent {
    position: relative;
    margin-left: 200px;
    margin-top: 50px;
    height: 450px;
    width: 50%;
    background-color: lightsalmon;
}
.coverphoto {
    height: 100px;
    width: 100%;
}
.coverphoto img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.profilephoto {
    height: 80px;
    width: 80px;
    position: absolute;
    top: 10%;
    left: 5%;
}
.profilephoto img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
}
            
This CSS code styles the page with a light salmon background for the parent div and ensures that images are responsive.