Advance Responsive Web Css HTML
Advance Responsive Web Css HTML
Banyak Device yang digunakan oleh pengguna untuk mem-browsing internet dengan
ukuran layer yang macam-macam, seperti gambar bawah:
WEB Design
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>HTML5 Responsive Demo Web Design | onlyWebPro.com</title>
</head>
<body>
<div id="site_wrapper">
<header id="header">
<hgroup>
<h1>Demo: HTML5 Responsive Web Design |
onlyWebPro.com</h1>
<h2>A blog for web designers & web developers</h2>
</hgroup>
<nav id="main_nav">
<ul>
<li class="current"><a
href="http://www.onlywebpro.com/category/html5-showcase/">HTML5
Showcase</a></li>
<li><a
href="http://www.onlywebpro.com/category/tutorials/html-css/">HTML
& CSS Tutorial</a></li>
WEB Design
<li><a
href="http://www.onlywebpro.com/category/tutorials/javascript/">JavaS
cript Tutorial</a></li>
<li><a
href="http://www.onlywebpro.com/category/tutorials/mobilecontent/">Mobile Content Tutorial</a></li>
<li><a
href="http://www.onlywebpro.com/category/tutorials/php/">PHP
Tutorial</a></li>
<li><a
href="http://www.onlywebpro.com/category/tutorials/search-engineoptimization/">SEO Tutorial</a></li>
</ul>
</nav>
</header><!-- END header -->
<section id="page_content">
<article>
<header>
<h3>HTML5 Responsive Web Design Tutorial</h3>
<p>Nowadays, users no longer just browse web on their
desktop. Users now use mobile devices such as iPhone, iPad or Samsung
Galaxy Tab to view the website. So as a web designer or web
developer, we shouldn't designed the web page in fixed width anymore.
This tutorial will show you how to create a cross-browser responsive
design with HTML5 & CSS3 media queries. <a
href="http://www.onlywebpro.com/2013/03/18/design-your-ownresponsive-web-template/">Read tutorial</a>
</p>
</header>
</article><!-- END article -->
</section><!-- END page_content -->
<aside id="sidebar">
<h3>Follow Us</h3>
<ul>
<li><a target="_blank"
href="http://www.facebook.com/pages/Connect-withonlyWebPro/149917668368025">Facebook</a></li>
<li><a target="_blank"
href="http://www.twitter.com/onlyWebPro">Twitter</a></li>
<li><a target="_blank"
href="https://plus.google.com/100910543735224109915">Google
Plus</a></li>
</ul>
</aside><!-- END sidebar -->
<footer>
}
h2 {
color: #000;
font-size: 20px;
font-weight: bold;
margin: 0;
color: #999;
font-size: 13px;
font-weight: normal;
margin: 0 0 10px;
h3 {
WEB Design
color: #222;
font-size: 16px;
font-weight: bold;
margin: 0;
}
a {
color: #09F;
text-decoration: none;
}
a:hover {
color: #333;
}
/*** Base Structure ***/
#site_wrapper {
margin: 0 auto;
width: 90%;
}
#page_content {
float: left;
width: 65%;
padding: 0 5% 3% 0;
}
#sidebar {
float: right;
width: 30%;
}
footer {
}
clear: both;
width: 100%;
WEB Design
#main_nav ul li.current a {
color: #333;
border-radius: 5px;
}
</style>
Responsive design is percentage based layout, instead of using fixed pixel value, we
used percentage value for the width of all base structures.
We aligned the main navigation button to left by specifying display:inline-block.
WEB Design
}
#main_nav ul li {
display: none;
margin: 0;
}
#main_nav ul li.current {
display: block;
}
#main_nav ul li a, #main_nav ul li.current a {
background: 0;
display: block;
padding: 5px 10px;
}
#main_nav ul li.current a {
color: #333;
}
#main_nav ul:hover li {
display: block;
}
}
On 650px breakpoint, we removed float property for page content container and
sidebar. We try to hide all main navigation by specifying display:none, but except
for the .current button. Then when users touch / mouse over on the main naigation,
we set the main navigation buttons back to display:block, this will turn the main
navigation into a dropdown box.
Save all your files and view it on browser. Then resize your browser window, you
should see your website automatically adjust its layout to suit your window.
Conclusion
You just learned how to design your own responsve web template. We hope you
enjoyed this tutorial and look forward to your feedback!
WEB Design