MEMBUAT TAMPILAN LAYOUT SEDERHANA HTML DAN CSS
kali ini saya akan memberikan tips membuat tampilan layout sederhana menggunakan html dan css.
langsung saja anda menuju ke langkah yang pertama :
Membuat file index
File style dengan nama file: style.css
Dan inilah hasilnya :
Demikian sedikit artikel mengenai belajar membuat layout sederhana menggunakan html dan css.
Semoga artikel saya ini dapat memberikan manfaat untuk anda dalam menyusun sebuah web.
langsung saja anda menuju ke langkah yang pertama :
Membuat file index
- Buat file baru dengan nama index.html
- Isikan source code berikut dalam file index.html.
<html>
<head>
<title>Layout Web News</title>
<link href="style.css" type="text/css" rel="stylesheet">
</head>
<body>
<center>
<div id="wrapper">
<div id="menu">
MENU
</div>
<div id="pencarian">
PENCARIAN
</div>
<div id="logo">
LOGO
</div>
<div id="header">
HEADER
</div>
<div id="nav">
NAV
</div>
<div id="berita1">
BERITA 1
</div>
<div id="berita2">
BERITA 2
</div>
<div id="berita3">
BERITA 3
</div>
<div id="login">
LOGIN
</div>
<div id="footer">
FOOTER
</div>
</div>
</center>
</html>
File style dengan nama file: style.css
#wrapper{ width:1000px;
height:750px;
background:grey;
margin-top:10px;
margin-left:10px;
margin-bottom:10px;
margin-right 10px;
padding:10px;
}
#menu { margin-bottom:10px;
height:50px;
width:750px;
background:aqua;
float:left;
}
#pencarian { margin-bottom:10px;
margin-left:50px;
height:50px;
width:200px;
background:red;
float:left;
}
#logo { margin-bottom:10px;
margin-right:20px;
height:150px;
width:150px;
background:yellow;
float:left;
}
#header { margin-bottom:10px;
height:150px;
width:810px;
background:green;
float:left;
padding:10px;
}
#nav {margin-bottom:10px;
height:50px;
width:1000px;
background:aqua;
float:left;}
#berita1 { margin-bottom:10px;
margin-right:20px;
height:250px;
width: 250px;
background:blue;
float:left;
clear:both;
}
#berita2 { margin-bottom:10px;
margin-right:20px;
margin-left:260px;
margin-top:-260px;
height:250px;
width: 250px;
background:blue;
float:left;
clear:both;
}
#berita3 { margin-bottom:10px;
margin-right:20px;
margin-left:520px;
margin-top:-260px;
height:250px;
width: 250px;
background:blue;
float:left;
clear:both;
}
#login { margin-bottom:10px;
margin-left:800px;
margin-top:-260px;
height:200px;
width:200px;
background:brown;
float:left;
}
#footer { margin-bottom:10px;
height:150px;
width:1000px;
background:aqua;
float:left;
padding:0px;
}
Save semua file dalam 1 folder.
Untuk Melihat hasilnya yaitu dengan cara buka file index.html di browser seperti Mozilla Firefox,Google Chrome dan lain sebagainya.Dan inilah hasilnya :
Semoga artikel saya ini dapat memberikan manfaat untuk anda dalam menyusun sebuah web.
Comments
Post a Comment