== Membuat layout halaman website dengan memanfaatkan elemen pada HTML5 (header, nav, section, section, article, aside, dan footer)
Pertama mendefinisikan style dan menyimpan dengan nama file .css body {
margin: 10px auto;
width: 750px;
}
header,nav,section,footer {
display:block;
border:1px solid blue;
}
right{
float: right;
}
header{
height:60px;
border: 1px solid green;
}
nav{
height:25px;
border: 1px solid blue;
}
section{
height:380px;
padding-left: 15px;
padding-right: 15px;
padding-top: 15px;
padding-bottom:15px;
border: 1px solid red;
}
article{
float:left;
width:520px;
height:360px;
border: 1px dashed red;
}
aside{
float:right;
width:170px;
height:360px;
border: 1px dashed blue;
}
footer{
clear:both;
height:20px;
border: 1px solid green;
}
margin: 10px auto;
width: 750px;
}
header,nav,section,footer {
display:block;
border:1px solid blue;
}
right{
float: right;
}
header{
height:60px;
border: 1px solid green;
}
nav{
height:25px;
border: 1px solid blue;
}
section{
height:380px;
padding-left: 15px;
padding-right: 15px;
padding-top: 15px;
padding-bottom:15px;
border: 1px solid red;
}
article{
float:left;
width:520px;
height:360px;
border: 1px dashed red;
}
aside{
float:right;
width:170px;
height:360px;
border: 1px dashed blue;
}
footer{
clear:both;
height:20px;
border: 1px solid green;
}
kemudian mendefinisikan HTML-nya, berikut adalah kode HTML-nya,
<!DOCTYPE HTML>
<html lang="en">
<head>
<title>Desain Layout Sederhana HTML5</title>
<link rel="stylesheet" href="StudiKasus.css" type="text/css"/>
</head>
<body>
<header>
header
</header>
<nav>
nav
</nav>
<section>
<article>
article
</section>
<aside>
aside
</aside>
section
</section>
<footer>
footer
</footer>
</body>
</html>
<html lang="en">
<head>
<title>Desain Layout Sederhana HTML5</title>
<link rel="stylesheet" href="StudiKasus.css" type="text/css"/>
</head>
<body>
<header>
header
</header>
<nav>
nav
</nav>
<section>
<article>
article
</section>
<aside>
aside
</aside>
section
</section>
<footer>
footer
</footer>
</body>
</html>
nah, inilah hasil tampilannya,
0 komentar:
Posting Komentar
silakan komen......