Topik Pertama CSS Layouting : DISPLAY
CSS Layuoting
Boxmodel
Float
Posisioning
Display
Dimensi
Over flow
Display : 2 tag ( Div, Span )
Tidak memiliki arti apapun, Tujuannya untuk mengelompokan bagian2 di website :
header, navigasi, konten, footer
Span : biasanya didalam konten
<html>
<head>
<title>CSS Dsiplay</title>
</head>
<body>
<h1>Selamat Datang di Sedulur Koding</h1>
<h2>Daftar Link</h2>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
<h2>Judul Artikel</h2>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
<p class="copyright">Copyright 2025 Sedulur Koding</p>
</body>
</html>
ditambahkan Style :
<style>
*{
width: 900px;
margin: 0 auto;
/* box-sizing: 1200px; */
}
.header {
background-color: aquamarine;
}
.navbar{
background-color: bisque;
}
.main {
background-color: salmon;
}
.footer {
background-color: rgb(94, 55, 51);
}
</style>
Konsep Container :
<html>
<head>
<title>CSS Dsiplay</title>
</head>
<style>
.container{
width: 900px;
margin: auto;
/* box-sizing: 1200px; */
}
.header {
background-color: aquamarine;
}
.navbar{
background-color: bisque;
}
.main {
background-color: salmon;
}
.footer {
background-color: rgb(94, 55, 51);
}
</style>
<body>
<div class="container">
<div class="header">
<h1>Selamat Datang di Sedulur Koding</h1>
</div>
<div class="navbar">
<h2>Daftar Link</h2>
<a href="#">Link 1</a>
<a href="#">Link 2</a>
<a href="#">Link 3</a>
</div>
<div class="main">
<h2>Judul Artikel</h2>
<p>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
</p>
<p>
It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.
</p>
</div>
<div class="footer">
<p class="copyright">Copyright 2025 Sedulur Koding</p>
</div>
</div>
</body>
</html>
VS Code
- Tanda Seru --> tab
- Open in Browser
Terima kasih

Post a Comment for "CSS Basic - Display"