PWEB - CSS
Tugas 3 (Membuat catalog)
Pada pertemuan 4 diberikan tugas untuk membuat catalog dengan mengimplementasikan CSS. Berikut merupakan tampilannya.
Source Code index.html
<!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" />
<link rel="stylesheet" href="styles.css" />
<title>TOKO OKOT</title>
</head>
<body>
<div class="header">
<a href="#" class="brand"><img src="image/logo.png" alt="" width="50" height="50" /></a>
<nav class="navbar">
<a href="#">Home</a>
<a href="#">Shop</a>
<a href="#">About us</a>
</nav>
</div>
<div class="category">
<div class="category-name">
<h2>Elektronik</h2>
</div>
</div>
<div class="item">
<div class="container-pics">
<img src="image/monitor.png" width="500px" height="300px" alt="" />
</div>
<div class="container-desc">
<div class="desc-box">
<div class="desc">
<h3>Monitor XXX</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati perspiciatis ab placeat pariatur quam iure laudantium, autem possimus nihil voluptate.</p>
</div>
<div class="price">
<p>Rp. 1.200.000</p>
</div>
<div class="btn">
<a href="#">Details</a>
</div>
</div>
</div>
<div class="container-pics">
<img src="image/2.png" width="500px" height="350px" alt="" />
</div>
<div class="container-desc">
<div class="desc-box">
<div class="desc">
<h3>TV XXX</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati perspiciatis ab placeat pariatur quam iure laudantium, autem possimus nihil voluptate.</p>
</div>
<div class="price">
<p>Rp. 4.800.000</p>
</div>
<div class="btn">
<a href="#">Details</a>
</div>
</div>
</div>
<div class="container-pics">
<img src="image/3.png" width="600" height="200px" alt="" />
</div>
<div class="container-desc">
<div class="desc-box">
<div class="desc">
<h3>Keyboard XXX</h3>
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Obcaecati perspiciatis ab placeat pariatur quam iure laudantium, autem possimus nihil voluptate.</p>
</div>
<div class="price">
<p>Rp. 400.000</p>
</div>
<div class="btn">
<a href="#">Details</a>
</div>
</div>
</div>
</div>
<div class="footer">
<p>© 2021 TOKO OKOT</p>
</div>
</body>
</html>
Source Code styles.css
body {
background-color: #2a0e1f;
color: #333;
width: 100%;
font-family: Verdana, Geneva, Tahoma, sans-serif;
margin: 0 auto;
}
.header {
width: 100%;
margin: auto;
height: auto;
background: #1b0913;
color: black;
position: fixed;
top: 0;
justify-content: space-between;
}
.brand {
font-weight: bold;
/* float: right; */
}
.header a {
color: black;
text-decoration: none;
float: left;
}
.navbar {
line-height: 50px;
}
.navbar a {
padding: 0px 36px;
text-decoration: none;
display: inline-block;
border: 2px solid #1b0913;
color: white;
font-weight: bold;
}
p {
color: white;
margin: 20px;
}
h2 {
color: white;
margin: 20px;
}
.category-name {
text-align: center;
padding-top: 100px;
}
.container-pics {
display: block;
text-align: center;
margin-left: auto;
margin-right: auto;
padding: 5%;
}
.container-desc {
width: 50%;
text-align: center;
margin: auto;
background: white;
border-radius: 10px;
opacity: 0.5;
}
.desc-box {
padding: 20px 100px;
}
.desc p {
text-align: center;
color: rgb(0, 0, 0);
}
h3 {
text-align: center;
color: rgb(0, 0, 0);
}
.price p {
text-align: center;
color: rgb(0, 141, 24);
font-weight: bold;
}
.footer {
padding-top: 20px;
padding-bottom: 20px;
margin-top: 50px;
float: left;
width: 100%;
text-align: center;
background: black;
}
.footer p {
margin: auto;
float: left;
width: 100%;
text-align: center;
background: black;
}
.navbar a:hover {
background-color: grey;
}
Link source code disini
Link website disini
Comments
Post a Comment