Tampilkan postingan dengan label Tutorial. Tampilkan semua postingan
Tampilkan postingan dengan label Tutorial. Tampilkan semua postingan

Minggu, 10 November 2013

Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Menjadikan File HTML di Google Drive Menjadi File Host HTML PublikBagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik - Cloud Computing adalah suatu paradigma di mana informasi secara permanen tersimpan di server di internet dan tersimpan sementara di komputer pengguna (client) termasuk di dalamnya adalah komputer tablet, notebook, komputer desktop, handheld dan lain-lain.

Nah!! google drive boleh dikatakan adalah salah satu bentuk cloud computing sementara dikembangkan oleh google. pada google drive bisa melakukan penyimpanan data secara online, menjadikan anda lebih produktif. membuat dokumen, presentasi, spreadsheet sendiri. Berbagi Publik file dengan orang lain.

Namun pada pembahasan kali ini, saya ingin berbagi pengetahuan tentang Bagaimana Cara Menjadikan File HTML atau File PHP di Google Drive Menjadi File Host HTML Publik di google drive. Berikut screenshot File HTML Publik yang saya upload di google drive :

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik
Demo : https://googledrive.com/host/0ByTiMnJfMclLeDh4eEZXQnpzbUE/index.html

Okay!! Berikut cara membuat File HTML atau File PHP di Google Drive Menjadi Host HTML Publik :

Langkah Pertama
- Tentunya anda sudah memiliki akun google gmail dan silahkan login di Google Drive disini.
- Memiliki File HTML yang siap dijadikan Host HTML Publik di Google Drive.
- Setelah Login di Akun Google Drive anda, Klik Create. Kemudian Pilih > Folder dan beri nama, misalnya nama Foldernya create. Berikut Screenshotnya :

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik


Langkah Kedua
- Buka folder tadi, yang diberi nama Create tadi.
- Upload file index.html anda di Folder Create, dengan cara klik tombol upload. Berikut Screenshotnya :

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik


Langkah Ketiga
Nah!! Langkah yang ketiga ini paling penting, karena folder create yang baru dibuat tadi berikut isi file index.html-nya harus di Setting Share Publik, agar supaya file index.html yang di dalam folder create tadi, berjalan sebagai Host HTML Publik. Klik Kanan Folder create kemudian pilih > Berbagi > Bagikan. Berikut Screenshotnya :

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Note:
File index.html nya tidak usah di share publik secara terpisah, karena otamatis ter-share melalui folder create tadi.

Langkah Keempat (Penutup)
Setelah di share ke publik, anda akan mendapatkan URL publik (Lihat Screenshoot diatas yang berwarna biru). Contohnya Seperti ini > https://drive.google.com/folderview?id=0ByTiMnJfMclLeDh4eEZXQnpzbUE&usp=sharing.

Perhatikan kode ID yg berwarna Biru, itulah kode ID Google Drive saya. Kemudian ubah arah URL agar supaya menjadi URL Host Publik. Contohnya Seperti ini > https://googledrive.com/host/0ByTiMnJfMclLeDh4eEZXQnpzbUE/index.html

Atau anda bisa copy langsung URL Host Publik anda, melalui file index.html, Caranya Klik Kanan file index.html kemudian Pilih > buka dengan > Penampil Google Drive Setelah menuju ke Penampil Google Drive, lalu kemudian klik > Pratinjau. Jangan lupa Copy Alamat URL di Adress Bar Browser Anda. berikut Sceenshootnya :

Bagaimana Cara Menjadikan File HTML di Google Drive Menjadi File Host HTML Publik

Sekian dari saya, tentang Bagaimana Cara Menjadikan File HTML atau File PHP di Google Drive Menjadi File Host HTML Publik.

Demo

Selamat Mencoba.

Rabu, 16 Oktober 2013

Kelebihan phpDesigner 8

phpDesigner 8Kelebihan phpDesigner Editor 8 adalah PHP IDE dan PHP Editor fast built-in HTML5, CSS3 dan editor JavaScript. di tambah fitur menarik membantu dalam pembuatan website dan pembuatan template. Selain pengeditan PHP, phpDesigner 8 juga di lengkapi pengeditan HTML5, CSS3 dan JavaScript. Berikut fitur pendukung dari phpDesigner 8 :

phpDesigner 8- Fast, powerful and intuitive to use
- PHP IDE and PHP editor
- HTML5-, CSS3- and JavaScript editor
- Code insight
- Debug and profile PHP with Xdebug
- PHP frameworks
- JavaScript frameworks Integration with GIT and SVN
- Work with files over FTP/SFTP

Syntax highlighters
Code Insight helps you master PHP, HTML5, CSS3 and JavaScript on the fly.

HTML5
Built-in code completion for HTML5. It can even suggest you the missing tag.

PHP Debugging
Analyze, evaluate, profile, find errors in your PHP code line by line with Xdebug.

PHP Frameworks
Supports all frameworks for PHP e.g. Zend, CodeIgniter, Yii and Symfony.

JS Frameworks
Supports libraries like jQuery, ExtJS, Yui, Dojo. MooTools and Prototype.

Themes
Syntax themes are customizable and also comes in black variants.

Code Insight untuk PHP, HTML5, CSS3 dan JavaScript, termasuk kerangka JavaScript jQuery populer lainnya.

Intelligent syntax highlighting for PHP, HTML5, CSS3, and JavaScript
Switch automatic between highlighters for PHP, HTML5, CSS3, and JavaScript dependant on your position in your code and dim the rest of the code so you can keep a focus on your code. You can even see syntax errors as you type.

Saya Paling suka phpDesigner 8 Editor ini daripada PHP Editor yang lain. Untuk informasi lengkap phpDesigner 8 silahkan kunjungi situs resminya disini

Download

Cara Cloning Template Blogger

Cloning TemplateCara Cloning Template - Berawal dari saya mencari di mbah google template Blogger Valid HTML5 + Responsive untuk mengganti template default bawaan dari blogger untuk Blog Sederhana saya ini, namun semuanya tidak sesuai dengan selera/keinginan saya hehehe :D Dalam pencarian Template Valid HTML5, saya di arahkan mbah google ke blog master om Agus Ramadhani dan Kang Ismet

Saya suka Tema Template kedua master Blog ini. Nah di sini muncul ide kreatif saya untuk meng-cloning template master blog ini. (Maaf ya om Agus dan Kang Ismet) hehehe Piss \m/_.._\m/ saya hanya sekedar mengembangkan kreatifitas saya, dan tidak akan share hasil Template clonengan buatan saya :).

Pertama kali saya clonng template Kang Ismet dan berhasil. Berikut screenshoot nya :

Cloning Template

Waktu Pembuatan template clonengan hanya membutuhkan waktu dua jam, termasuk menyusun formulasi template, dan menemukan kode kode yang disembunyikan atau yang tidak ditampilkan, sampai proses upload template di blogger. Dalam pembuatan template, anda tidak perlu repot-repot mencari template yang mirip mirip template bawaan template orang yang anda akan di cloning. cukup copy source code templatenya saja.

Disini saya tidak akan share hasil Template clonengan blog master buatan saya, namun saya akan memberitahukan cara cloning template blog orang lain. Okay !! mari kita langsung aja caranya (simak baik-baik) :

Dalam Bahasan postingan ini, saya kasih contoh cloning template blog saya sendiri, hasil clonengan dari template Blog om master blog Agus Ramadhani atau biasa dikenal di sebut o-om.com

Pertama
Hal pertama yang anda lakukan pilih salah satu postingan template target anda, terserah anda postingan apa aja!!. Setelah memilih salah satu postingan, lalu klik kanan di area bebas. Klik Kanan > Lihat Code Sumber Laman. Jika browser di kommputer anda berbahasa inggris kira-kira seperti ini: Right Click > See Source Code. (saya menggunakan Browser Firefox Berbahasa Indonesia). Lalu buat Notepad, dan copy semua Source code halaman postingan pilihan anda, Paste lalu beri Judul notepad anda "dplkt-halaman-postingan.txt" (tanpa tanda kutip). atau "dplkt-halaman-postingan.xml" (tanpa tanda kutip). Jangan Lupa Buat Folder Baru dan Beri judul "Duplikat Template" (Tanpa Tanda Kutip). Simpan Hasil Copian Sorce Code anda di folder tersebut, biar gampang di ingat.

Kedua
Perlu di ketahui, susunan Template Blog umumnya seperti ini :

  • Header Wrapper terdiri dari Header Left dan Header Right. (pada Template duplikat saya, seperti ini Header Inner dan .blog-desc)
  • Outer Wrapper terdiri dari Main Wrapper dan Sidebar Wrapper.
  • Footer Wrapper terdiri dari Bottom Left, Bottom Center dan Bottom Right
  • Credit Wrapper.

Okay!! anda mulai dari bawah code HTML dulu, hasil dari copian sorce code tadi. Cari dan perhatikan baik-baik code pada bagian Footer Wrapper, misalnya seperti ini: <div id='footer-wrapper'>

Susunan code bagian Footer Wrapper dari template duplikat saya, terdiri dari :

<div id='footer-wrapper'>
<div id='bottom'> ..... susunan dari Bottom terdiri dari :
- left-bottom
- center-bottom
- right-bottom
<div id='upper-footer'> dan
<div class='credits'>

Contoh code pada bagian Footer Wrapper:

<div id='footer-wrapper'>
<div id='bottom'>
<div class='bottom section section' id='left-bottom'><div class='widget HTML' id='HTML4'>
<h2 class='title'>About Me</h2>
<div class='widget-content'>
<div class="profile-textblock">
<!-- isi widget ABOUT ME saya hapus -->
</div>
</div>
</div></div>


Note:
  • Perhatikan code yang berwarna merah. yang berwarna merah, Hapus saja.
  • Perhatikan code yang berwarna Hijau, code div ganti dengan b:section lalu tambahkan preferred='yes' di belakang code id='left-bottom', sehingga hasilnya seperti ini :

<b:section class='bottom section' id='left-bottom' preferred='yes'/>

Lalu lanjut pada bagian center-bottom dan right-bottom. dan hasil lengkap dari b:section widget pada sub bagian bottom seperti ini :

<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>

Hasil Selengkapnya pada sub bagian Bottom dari Footer Wrapper seperti ini :

<div id='footer-wrapper'>
<div id='bottom'>
<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>
<div id='upper-footer'>
<b:section class='footer section' id='footer' preferred='yes'/>
</div> <!-- end upper footer -->
</div> <!-- end bottom -->
<div class='credits'>
</div> <!-- end credits -->
</div> <!-- end footer wrapper -->

Note:
Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> tersebut.

Ketiga
Lanjut pada bagian Outer Wrapper yang terdiri dari Main Wrapper dan Sidebar Wrapper.

Contoh susunan bagian Outer Wrapper :

<div id='main-wrapper'>
<div id='main-wrapper-border'> <-- ini sekedar tambahan style border saja, sebelah kanan body postingan tebalnya 5px
<div id='sidebar-wrapper'>

Pada bagian Outer Wrapper ini, sama seperti cara menyusun bagian Footer Wrapper, namun khusus pada bagian b:section Main, anda sisa meng-copy saja code template yang lama milik anda. Contohnya seperti ini :

<div id='outer-wrapper'>
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->

Note:
  • Yang berwarna biru mulai star peng-copian dari template blog lama anda sampai akhir dari </b:section>.
  • Khusus code </div> penutup untuk Outer Wrapper belum ditambahkan dari keterangan diatas, karena masih ada Sidebar Wrapper. Nantinya code </div> penutup untuk Outer Wrapper akan di sematkan tepat dibawah Sidebar Wrapper.
  • Dalam kasus ini, saya meng-copy isi code Main Wrapper dari template default bawaan blogger. mengingat masih lengkap, masih perawan, Karena belum ada pengurangan atau pengeditan yang saya lakukan dari template default bawaan blogger tersebut. (isi dari code Blog Post dan isi code Comments).

Selanjutnya, anda lanjut pada sub bagian Sidebar Wrapper. Lihat contoh di bawah ini :

<div id='sidebar-wrapper'>
<div class='inner-box section section' id='inner-box'><div class='widget Feed' id='Feed1'>
<h2>New Post</h2>
<div class='widget-content' id='Feed1_feedItemListDisplay'>
<span style='filter: alpha(25); opacity: 0.25;'>
<a href='http://metropersonal.blogspot.com/feeds/posts/default'>Memuat...</a>
</span>
</div>
</div>


Note:
  • Perhatikan code yang berwarna merah. yang berwarna merah, Hapus saja.
  • Perhatikan code yang berwarna Hijau, code div ganti dengan b:section lalu tambahkan preferred='yes' di belakang code id='inner-box', sehingga hasilnya seperti ini :

<b:section class='inner-box section' id='inner-box' preferred='yes'/>

Hasil Selengkapnya pada sub bagian Sidebar Wrapper dari Outer Wrapper seperti ini :

<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->

Dan sebagai penutup bahasan bagian Outer Wrapper, berikut Hasil Selngkap-lengkapnya :

<div id='outer-wrapper'>
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->
<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->
<!-- spacer for skins that want sidebar and main to be the same height-->
<div class='clear'>&#160;</div> <!-- clear fix do not remove -->
<br/>
</div> <!-- end outer-wrapper -->
</div> <!-- end outer wrapper line -->
<div class='clear'/>
<div class='backtotop'><a href='#'>Back to Top</a></div>

Note:
  • Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> penutup tersebut.
  • Khusus untuk code penutup </div> <!-- end outer wrapper line --> ini, fungsinya sebagai code </div> penutup dari data vocabulary Review, gunanya untuk merating semua postingan anda, letak tepatnya, anda bisa lihat tepat dibawah code <body>

Keempat
Selanjutnya, anda lanjut pada bagian Header Wrapper, sebagai akhir dari pembahasan code ini. Berikut Susunan code dari Header Wrapper :

<div id='branding'>
<div id='head-inner'>
<div id='header-wrapper'>

Header Wrapper terdiri dari Blog Desc dan Header. Pada bagian Header Wrapper ini, sama seperti cara menyusun bagian Outer Wrapper, namun khusus pada bagian b:section Header, anda sisa meng-copy saja code template yang lama milik anda. Contohnya seperti ini :

<div id='branding'>
<div id='head-inner'>
<div id='header-wrapper'>
<b:section class='blog-desc section' id='blog-desc' preferred='yes' showaddelement='yes'/>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'> <---(star copy) mulai copy semua code b:section Header, dari template blog anda yang lama sampai....
<b:widget id='Header1' locked='true' title='Metro Personal (Header)' type='Header'>
<b:includable id='main'>
<b:if cond='data:useImage'>
<b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end header wrapper -->
</div> <!-- end head inner -->
</div> <!-- end branding -->

Note:
  • Pada bagian blog-desc section, saya tambahkan showaddelement='yes' yang nantinya anda akan ganti menjadi 'no' setelah anda mengisi deskripsi tambahan agar supaya tidak ada penambahan widget lagi. Khusus deskripsi tambahan saja.
  • Yang berwarna biru mulai star peng-copian dari template blog lama anda sampai akhir dari </b:section>.
  • Perhatikan dan teliti baik-baik code </div> sebagai code penutup. Jangan sampai ada yang salah dalam penempatan code </div> penutup tersebut.

Kelima (penutup)
Rangkuman hasil Duplikat Template dari semua pembahasan code HTML diatas sebagai berikut :

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<HTML>
<head>
<meta charset='utf-8'/>
<!-- Sisipkan Code META TAG disini -->
//////////////////////////////////////////////
<!-- Sisipkan Code CSS disini -->
]]></b:skin>
<!-- Sisipkan Code Javascript RELATED POST disini -->
<!-- Sisipkan Code Javascript AUTO READ MORE disini -->
<!-- Sisipkan Code Javascript MOBILE MENU disini -->
</head>
<body>
<div><div itemscope='' itemtype='http://data-vocabulary.org/Review'>
<div id='branding'>
<!-- Sisipkan Code Social Facebook dll disini -->
<!-- Sisipkan Code Search disini -->
<div id='head-inner'>
<div id='header-wrapper'>
<b:section class='blog-desc section' id='blog-desc' preferred='yes' showaddelement='yes'/>
<b:section class='header' id='header' maxwidgets='1' showaddelement='no'> <---(star copy) mulai copy semua code b:section Header, dari template blog anda yang lama sampai....
<b:widget id='Header1' locked='true' title='Metro Personal (Header)' type='Header'>
<b:includable id='main'>
<b:if cond='data:useImage'>
<b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini.
</div> <!-- end header wrapper -->
</div> <!-- end head inner -->
</div> <!-- end branding -->
//////////////////////////////////////////////
<!-- Sisipkan Code Stripe Style disini -->
<div id='outer-wrapper'>
<!-- Sisipkan Code Javascript MOBILE MENU disini -->
<!-- Sisipkan Code Menu Navigasi disini -->
<div id='main-wrapper'>
<div id='main-wrapper-border'>
<b:section class='main' id='main' showaddelement='no'> <---(star copy) mulai copy semua code b:section Main, dari template blog anda yang lama sampai....
<b:widget id='Blog1' locked='true' title='Posting Blog' type='Blog'>
<b:includable id='main' var='top'>
.
.
.
<!-- bla bla bla bla bla -->
.
.
.
</b:includable>
</b:widget>
</b:section> <-- sampai dengan akhir dari code ini
</div> <!-- end main wrapper border -->
</div> <!-- end main wrapper -->

<div id='sidebar-wrapper'>
<b:section class='inner-box section' id='inner-box' preferred='yes'/>
</div> <!-- end sidebar wrapper -->

<!-- spacer for skins that want sidebar and main to be the same height-->
<div class='clear'>&#160;</div> <!-- clear fix do not remove -->
<br/>
</div> <!-- end outer-wrapper -->
</div> <!-- end outer wrapper line -->

<div class='clear'/>
<div class='backtotop'><a href='#'>Back to Top</a></div>
//////////////////////////////////////////////
<div id='footer-wrapper'>
<div id='bottom'>
<b:section class='bottom section' id='left-bottom' preferred='yes'/>
<b:section class='bottom section' id='center-bottom' preferred='yes'/>
<b:section class='bottom section' id='right-bottom' preferred='yes'/>
<div id='upper-footer'>
<b:section class='footer section' id='footer' preferred='yes'/>
</div> <!-- end upper footer -->
</div> <!-- end bottom -->
<div class='credits'>
</div> <!-- end credits -->
</div> <!-- end footer wrapper -->

</div>
</body>
</HTML>

Note:
Untuk code Meta Tag silahkan kunjungi Blog Kedua Master yang saya sebutkan diatas, disini dan disini

Bila ada yang kurang jelas silahkan tanyakan melalui kotak komentar dibawah. Selamat Mencoba!!
Keep Spirit and Keep Imagination...Enjoy!! :)

Sabtu, 12 Oktober 2013

Automatic Background Color different Every Post Blogger

Background ColorAutomatic Background Color different Every Post Blogger - Easy!! Find the code </head> then put the following Javascript code just above the </head>

Background Color

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 14)];
}
return color;
}
$(function() {
$(".post").each(function() {
$(this).css("background-color", get_random_color());
});
});
//]]>
</script>

If you just want to change the color of posts on the main page alone you stay just use conditional tags like the code below:

<b:if cond='data:blog.url == data:blog.homepageUrl'>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=1.5' type='text/javascript'/>
<script type='text/javascript'>
//<![CDATA[
function get_random_color() {
var letters = '0123456789ABCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++ ) {
color += letters[Math.round(Math.random() * 14)];
}
return color;
}
$(function() {
$(".post").each(function() {
$(this).css("background-color", get_random_color());
});
});
//]]>
</script>
</b:if>

Display different colors on the background of each posting may be ideal only for Templates with Style Gallery. But there is no harm if you want to try.

Using CSS/HTML to Make a Responsive Website

ResponsiveUsing CSS/HTML to Make a Responsive Website - A website is responsive if it is able to adapt to the screen of the client. In this article, I�ll show you how to easily make a website responsive in three easy steps.

The layout
When building a responsive website, or making responsive an existing site, the first element to look at is the layout. When I build responsive websites, I always start by creating a non-responsive layout, fixed at the default size. For example, CatsWhoCode.com default width is 1100px. When I�m pleased with the non-responsive version, I add media queries and slight changes to my code to make the code responsive. It�s way easier to focus on one task at a time.

When you�re done with your non-responsive website, the first thing to do is to paste the following lines within the <head> and </head> tags on your html page. This will set the view on all screens at a 1�1 aspect ratio and remove the default functionality from iPhones and other smartphone browsers which render websites at full-view and allow users to zoom into the layout by pinching.

<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">

It�s now time to add some media queries. According to the W3C site, a media query consists of a media type and zero or more expressions that check for the conditions of particular media features. By using media queries, presentations can be tailored to a specific range of output devices without changing the content itself. In other words, media queries allows your website to look good on all kinds of displays, from smartphones to big screens.

Media queries depends of your website layout, so it�s kinda difficult for me to provide you a ready to use code snippet. However, the code below is a good starting point for most websites. In this example, #primary is the main content area, and #secondary the sidebar.

By having a look at the code, you can see that I defined two sizes: The first have a maximum width of 1060px and is optimized for tablet landscape display. #primary occupies 67% of its parent container, and #secondary 30%, plus a 3% left margin.

The second size is designed for tablet portrait and smaller sizes. Due to the small sizes of smartphones screens, I decided to give #primary a 100% width. #secondary also have a 100% width, and will be displayed below #primary.

As I already said, you�ll probably have to adapt this code a bit to fit the specific needs of your website. Paste it on your site .css file.

/* Tablet Landscape */
@media screen and (max-width: 1060px) {
#primary { width:67%; }
#secondary { width:30%; margin-left:3%;}
}

/* Tabled Portrait */
@media screen and (max-width: 768px) {
#primary { width:100%; }
#secondary { width:100%; margin:0; border:none; }
}

Once done, let�s see how responsive your layout is. To do so, I use this awesome tool created by Matt Kersley.

Medias
A responsive layout is the first step to a fully responsive website. Now, let�s focus on a very important aspect of a modern website: medias, such as videos or images.

The CSS code below will ensure that your images will never be bigger than their parent container. It�s super simple and it works for most websites. Please note that the max-width directive is not recognized by older browsers such as IE6. In order to work, this code snippet have to be inserted into your CSS stylesheet.

img { max-width: 100%; }

Although the technique above is efficient, sometimes you may need to have more control over images and display a different image according to the client display size.

Here is a technique developed by Nicolas Gallagher. Let�s start with the html:

<img src="image.jpg"
data-src-600px="image-600px.jpg"
data-src-800px="image-800px.jpg"
alt="">

As you can see, we used the data-* attribute to store replacement images urls. Now, let�s use the full power of CSS3 to replace the default image by one of the specified replacement images if the min-device-width condition is matched:

@media (min-device-width:600px) {
img[data-src-600px] {
content: attr(data-src-600px, url);
}
}

@media (min-device-width:800px) {
img[data-src-800px] {
content: attr(data-src-800px, url);
}
}

Impressive, isn�t it? Now let�s have a look to another very important media in today�s websites, videos.

As most websites are using videos from third parties sites such as YouTube or Vimeo, I decided to focus on the elastic video technique by Nick La. This technique allows you to make embedded videos responsive.

The html:

<div class="video-container">
<iframe src="http://player.vimeo.com/video/6284199?title=0&byline=0&portrait=0" width="800" height="450" frameborder="0"></iframe>
</div>

And now, the CSS:

.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

Once you applied this code to your website, embedded videos are now responsive.

Typography
The last step of this tutorial is definitely important, but it is often neglected by developers when it comes to responsive websites: Typography.

Until now, most developers (including myself!) used pixels to define font sizes. While pixels are ok when your website has a fixed width, a responsive website should have a responsive font. Indeed, a responsive font size should be related to its parent container width, so it can adapt to the screen of the client.

The CSS3 specification included a new unit named rems. They work almost identically to the em unit, but are relative to the html element, which make them a lot easier to use than ems.

As rems are relative to the html element, don�t forget to reset html font size:

html { font-size:100%; }

Once done, you can define responsive font sizes as shown below:

@media (min-width: 640px) { body {font-size:1rem;} }
@media (min-width:960px) { body {font-size:1.2rem;} }
@media (min-width:1100px) { body {font-size:1.5rem;} }

Please note that the rem unit is not recognized by older browers, so don�t forget to implement a fallback. That�s all for today � I hope you enjoyed this tutorial!