Tutorial Details
Program: Code editor of your choice
Difficulty: Beginner
Estimated completion time: 1.5 - 2 hours
View post on Tuts+ BetaTuts+ Beta is an optimized, mobile-friendly and easy-to-read version of the Tuts+ network.
This entry is part 3 of 3 in the Iconify: A Complete Website Session
Previous
Its been a while coming, but today, during the coding phase of this massive tutorial, were going to begin the HTML conversion of
our theme. Weve already designed the whole thing in Photoshop, so now well look at converting our homepage into a valid HTML
web page.
Throughout our conversion phase well follow best practices, use valid HTML 5 (doctype, though none of the newer spec elements)
and CSS 2.1 for maximum browser support.
Phase 1
Create document/folder/site structure.
Define document type.
Inspect the main design and figure out the overall basic markup.
Inspect the specific page sections to get an idea as to how to mark it up.
Insert HTML tags according to our markup ideas and finish the HTML coding.
Phase 2
Reset the default styles of browsers.
Add some default styles for common HTML elements.
Position and design elements sequentially from top to bottom and section by section.
Phase 3
Well check our design in all modern browsers and compensate for IE.
Finally, well add some behavior to our theme with some custom and third party jQuery plugins and scripts.
Our theme is very simple, so we need to slice very few graphics from our design. Those graphics that we do slice will be done as
necessary as we approach the HTML and CSS. Please follow the tutorial from start to finish attentively as Ill discuss each trick only
once.
1 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Content (HTML/XHTML)
Presentation (CSS) and
Behavior (JS)
Todays three sub-parts are defined below. Feel free to jump back and forth when youre proficient at a certain skill outlined in a
specific section.
Part A Content Creating markup and populating the page With content.
Part B Presentation Positioning and designing content with pure CSS.
Part C Behavior Defining interactions with JavaScript
In the assets folder, well place all our assets images, videos, flash, etc.
In the files folder, there are two subfolders named, codes and images.
The folder named codes is for css (Style Sheet) and js (JavaScript) files.
All our images used for creating this theme will be placed inside the images folder.
Our HTML files will be directly inside the ICONIFY folder.
2 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
</body>
</html>
This is an HTML 5 document and were ensuring this by setting its doctype to . In the head section, were placing some meta tags like-
author, description, keywords these meta tags help search engines to easily find and index our web pages. We are also declaring our
pages title and favicon.
3 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
By inspecting the homepage design, we find three horizontal sections: #header, #content, and #footer. Two (header, footer) of these
three sections are static, because they are going to be same throught-out the site. So, depending on this preliminary markup idea
from the design, our HTML markup will be:
<body>
<div id="header">
<div class="inner">
header
4 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Our three vertical sections are div#header, div#content, and div#footer. Also note that within each section, theres a div.inner element,
this is for the glow effect of every section and well also place all our elements inside these div.inner containers.
Note: every closing tag has an associated comment, which describes the element that is being closed. Its best practice to always
comment out important parts or sections in an HTML document. Well follow this practice today.
Now lets populate our three sections with HTML contents, sequentially from header to footer
Were going to slice our first image, the logo, so open the index design in Photoshop. Select the Slice tool from inside the Crop Tool
group. Now use images A 4b and A 4c as a guideline to crop your logo. Then goto File->Save for Web & Devices or press
Alt+Shift+Ctrl+S from key board to call the Save for Web & Devices dialogue box. Select PNG-24 and Transparent then save to our
web roots files->images folder as shown in image A 4d.
5 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
6 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Well use these same techniques/steps for slicing our next images. Only the dimensions will be mentioned from now on.
Lets fill up the #header section with associated contents. Copy the following into your document:
<div id="header">
<div class="inner">
<ul class="top">
<li><a href="#">Downloads</a></li>
<li><a href="#">Newsletter</a></li>
<li><a href="#">Login</a></li>
<li>
<form action="#" method="get">
<fieldset>
<legend>Search Form</legend>
<label for="searchTerm">Search</label>
<input type="text" name="searchTerm" id="searchTerm" size="40" maxlength="150" />
<input type="submit" value="Search" />
</fieldset>
</form>
</li>
</ul><!-- end of .top -->
<div id="nav">
<div id="logo">
<a href="#"><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/images/logo.png" height=
</div><!-- end of #logo -->
<ul id="menu">
<li class="active"><a href="index.html">Home</a></li>
7 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Our ul.top is a list element and thus is made up of li elements. The last child of ul.top holds our search form. Inside div#nav, there
are two immediate children: div#logo and ul#menu. ul#menu is a list element and all its children are menu items. Notice that one
menu item has a class li.active and one menu item has a class li.dropdown. Those are to merely indicate active and dropdown
menu items respectively.
8 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
After inspecting the content section in the design, we can plan our HTML sub-sections inside the #content section as shown below.
<div id="content">
<div class="inner">
<div id="slider">
<ul id="cycle">
</ul>
<div id="cyclePager"></div>
</div><!-- end of #slider -->
<ul class="promo-col-4">
</ul><!-- end of .promo-col-4 -->
<hr />
<ul class="promo-col-3">
</ul><!-- end of .promo-col-3 -->
<div class="testimonial">
</div><!-- end of .testimonial -->
<div id="recentProjects">
<div class="bar">
</div><!-- end of .bar -->
<ul class="">
</ul><!-- end of . -->
</div><!-- end of #recentProjects -->
</div><!-- end of .inner -->
</div><!-- end of #content -->
Now were going to fill up the #content section with some contents, sequentially, from top to bottom. Copy the following code into
your html document.
<div id="slider">
<ul id="cycle">
<li><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/slides/1.jpg" height="336" width="9
9 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Inside #slider weve three image links, which are our slides. And a div#cyclePager for the pager or slider navigation.
<ul class="promo-col-4">
<li class="">
<a href="#" title="Unlimited Columns With 960 Grid">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/blueprint.png" height="48" width=
</a>
<h5><a href="#" title="Unlimited Columns With 960 Grid">Unlimited Columns With 960 Grid</a></h5>
</li>
<li class="">
<a href="#" title="Unlimited Colors (Change CSS Hex)">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/colouralt.png" height="48" width=
</a>
<h5><a href="#" title="Unlimited Colors (Change CSS Hex)">Unlimited Colors (Change CSS Hex)</a></h5>
</li>
<li class="">
<a href="#" title="Display Images With A Unique Flair">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/photos.png" height="48" width="48
</a>
<h5><a href="#" title="Display Images With A Unique Flair">Display Images With A Unique Flair</a></h5>
</li>
<li class="">
<a href="#" title="Supports All Modern Browsers">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/safari.png" height="48" width="48
</a>
<h5><a href="#" title="Supports All Modern Browsers">Supports All Modern Browsers</a></h5>
</li>
</ul><!-- end of .promo-col-4 -->
<hr />
This is a 4 column promotional item named ul.promo-col-4 and well see how to position them according to our design in the CSS
portion. Its structure is pretty simple just place every columns elements inside a li of ul.promo-col-4.
10 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
<ul class="promo-col-3">
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/1.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/2.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/3.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
</ul><!-- end of .promo-col-3 -->
11 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
This promotional section is the same as ul.promo-col-4, the only difference being that it has 3 columns. And it render in browsers as
follows:
<div class="testimonial">
<div class="inner">
<blockquote>
A color management system reconciles color differences among devices so that you can be reasonably certain of the colors your sy
</blockquote>
<span class="arrow"><!-- blockquote box arrow --></span>
</div>
<cite>
<strong>Thomas Miller</strong> CEO, envato
</cite>
</div><!-- end of .testimonial -->
This is the featured testimonial box in the homepage. Inside the div.testimonial parent element, we place a blockquote element
within a div.inner element. This div.inner element is for the inner darker stroke of the testimonial box. Well use some techniques
in the CSS portion to design the testimonial box.
<div id="recentProjects">
<div class="bar">
<h5>
Recent Projects
</h5>
</div><!-- end of .bar -->
<ul class="">
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/1.jpg" class="bor
</a>
12 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/2.jpg" class="bor
</a>
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/3.jpg" class="bor
</a>
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/4.jpg" class="bor
</a>
</li>
</ul><!-- end of .projects -->
</div><!-- end of #recentProjects -->
div#recentProjects has two children: div.bar for the heading and a ul element with four li children for the recent projects items.
Check out the browser preview:
13 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
After inspecting the footer section in the design we can plan our HTML sub-sections inside the #footer section as shown below.
<div id="footer" class="">
<div class="inner">
<div class="top">
</div><!-- end of .top -->
<ul class="content">
</ul><!-- end of .content -->
<div class="bottom">
</div><!-- end of .bottom -->
</div><!-- end of .inner -->
</div><!-- end of #footer -->
There are two immediate children inside div.top:, one for our lovely twitter plugin named div#twitter and another one for our
social links- ul.social.
<ul class="content">
14 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
<li class="">
<h5>About ICONIFY</h5>
<p>
Creating themes to give away or sell is great, but not everyone who uses your theme will have a solid understanding of HTML/CSS.
</p>
</li>
<li class="">
<h5>Categories</h5>
<ul class="list">
<li><a href="#" title="Graphics Design">Graphics Design</a></li>
<li><a href="#" title="Web Graphics">Web Graphics</a></li>
<li><a href="#" title="User Interface Designing">User Interface Designing</a></li>
<li><a href="#" title="3D Graphics">3D Graphics</a></li>
<li><a href="#" title="Web Development">Web Development</a></li>
<li><a href="#" title="Programming">Programming</a></li>
<li><a href="#" title="Scripting">Scripting</a></li>
<li><a href="#" title="Wordpress">Wordpress</a></li>
<li><a href="#" title="Cartooning">Cartooning</a></li>
<li><a href="#" title="Object Oriented Development">Object Oriented Development</a></li>
<li><a href="#" title="Information Architecture">Information Architecture</a></li>
</ul><!-- end of .cat -->
</li>
<li class="">
<h5>Recent Posts</h5>
<ul class="blogList">
<li>
<a href="#" title=""><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/80x80.jpg" cla
<h5><a href="#">Developing Future Web Apps</a></h5>
<p>
Creating themes to give away or sell is great, everyone who uses your theme will have a solid understanding of HTML/CSS.
</p>
</li>
<li>
<a href="#" title=""><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/80x80.jpg" cla
<h5><a href="#">Developing Future Web Apps</a></h5>
<p>
Creating themes to give away or sell is great, everyone who uses your theme will have a solid understanding of HTML/CSS.
</p>
</li>
</ul><!-- end of .blogList -->
</li>
</ul><!-- end of .content -->
The ul.content is a three column section and each li element is a column. Well use some tricks in the CSS portion to properly style
and position them out.
<div class="bottom">
<a href="#" id="toTop" title="Scroll To Top"></a>
<hr />
<p class="copyright">
Copyright © <a href="#" title="ICONIFY">ICONIFY</a> 2011-2015, All Rights Reserved.
<span style="float: right;">
Template By: <a href="http://themeforest.net/user/palpaldal/" title="palpaldal's Themeforest Profile">palpaldal</a>
</span>
</p>
</div><!-- end of .bottom -->
15 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
16 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
</li>
</ul><!-- end of .top -->
<div id="nav">
<div id="logo">
<a href="#"><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/images/logo.png" height=
</div><!-- end of #logo -->
<ul id="menu">
<li class="active"><a href="index.html">Home</a></li>
<li class="dropdown"><a href="#">Features</a></li>
<li><a href="portfolio.html">Portfolio</a></li>
<li><a href="blogs.html">Blog</a></li>
<li><a href="contact.html">Contact</a></li>
</ul><!-- end of #menu -->
</div><!-- end of #nav -->
</div><!-- end of .inner -->
</div><!-- end of #header -->
<div id="content">
<div class="inner">
<div id="slider">
<ul id="cycle">
<li><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/slides/1.jpg" height="336" width="9
<li><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/slides/2.jpg" height="336" width="9
<li><img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/slides/3.jpg" height="336" width="9
</ul>
<div id="cyclePager"></div>
</div><!-- end of #slider -->
<ul class="promo-col-4">
<li class="">
<a href="#" title="Unlimited Columns With 960 Grid">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/blueprint.png" height="48" width=
</a>
<h5><a href="#" title="Unlimited Columns With 960 Grid">Unlimited Columns With 960 Grid</a></h5>
</li>
<li class="">
<a href="#" title="Unlimited Colors (Change CSS Hex)">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/colouralt.png" height="48" width=
</a>
<h5><a href="#" title="Unlimited Colors (Change CSS Hex)">Unlimited Colors (Change CSS Hex)</a></h5>
</li>
<li class="">
<a href="#" title="Display Images With A Unique Flair">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/photos.png" height="48" width="48
</a>
<h5><a href="#" title="Display Images With A Unique Flair">Display Images With A Unique Flair</a></h5>
</li>
<li class="">
<a href="#" title="Supports All Modern Browsers">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/icons/safari.png" height="48" width="48
</a>
<h5><a href="#" title="Supports All Modern Browsers">Supports All Modern Browsers</a></h5>
</li>
</ul><!-- end of .promo-col-4 -->
<hr />
<ul class="promo-col-3">
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/1.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/2.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
<li class="">
<a href="#" title="Using Clone Stamp Tool">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/promo/3.jpg" class="border" height=
</a>
<h4><a href="#">Using Clone Stamp Tool</a></h4>
<p>
To use the Clone Stamp tool, you tset a sampling point on the area you want to copy (clone) the pixels from and paint over anoth
</p>
<a href="#" class="btn" title="Read More">Read More</a>
</li>
</ul><!-- end of .promo-col-3 -->
17 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
<div class="testimonial">
<div class="inner">
<blockquote>
A color management system reconciles color differences among devices so that you can be reasonably certain of the colors your sy
</blockquote>
<span class="arrow"><!-- blockquote box arrow --></span>
</div>
<cite>
<strong>Thomas Miller</strong> CEO, envato
</cite>
</div><!-- end of .testimonial -->
<div id="recentProjects">
<div class="bar">
<h5>
Recent Projects
</h5>
</div><!-- end of .bar -->
<ul class="">
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/1.jpg" class="bor
</a>
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/2.jpg" class="bor
</a>
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/3.jpg" class="bor
</a>
</li>
<li class="">
<a href="#" >
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/rcnt-projects/4.jpg" class="bor
</a>
</li>
</ul><!-- end of ul -->
</div><!-- end of #recentProjects -->
</div><!-- end of .inner -->
</div><!-- end of #content -->
<div id="footer">
<div class="inner">
<div class="top">
<div id="twitter" class="">
<!-- Twitter plugin jQuery.getTwitter will automatically fillup this div -->
</div><!-- end of #twitter -->
<ul class="social">
<li><h5>Get Social</h5></li>
<li>
<a href="#" title="RSS">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/social-icons/rss.png" height="32" w
</a>
</li>
<li>
<a href="#" title="Flickr">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/social-icons/flickr.png" height="32
</a>
</li>
<li>
<a href="#" title="Facebook">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/social-icons/facebook.png" height="
</a>
</li>
<li>
<a href="#" title="Twitter">
<img src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/assets/social-icons/twitter.png" height="3
</a>
</li>
</ul><!-- end of .social -->
</div><!-- end of .top -->
<ul class="content">
<li class="">
<h5>About ICONIFY</h5>
<p>
Creating themes to give away or sell is great, but not everyone who uses your theme will have a solid understanding of HTML/CSS.
</p>
</li>
<li class="">
<h5>Categories</h5>
<ul class="list">
<li><a href="#" title="Graphics Design">Graphics Design</a></li>
<li><a href="#" title="Web Graphics">Web Graphics</a></li>
<li><a href="#" title="User Interface Designing">User Interface Designing</a></li>
18 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Part B Presentation
Weve finished the markup portion of this tutorial, lets move on to the CSS.
First, create some blank CSS files inside your css folder. Youll also need to download and link prettyPhoto.css file and 960.css file
from the Nomarginsforerroe and 960 website respectively. Create and link your CSS style sheets from inside your document head as
shown below:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Nuruzzaman Sheikh(palpaldal)" />
<meta name="description" content="A brief description of this website or your business." />
<meta name="keywords" content="keywords, or phrases, suited with each particular page, are best" />
<title>ICONIFY :: Welcome</title>
<!-- Favorites icon -->
<link rel="shortcut icon" href="assets/favicon.ico" />
<!-- CSS Files -->
<!-- Resetting all default browser markups and styles.-->
<link rel="stylesheet" type="text/css" href="files/codes/css/reset.css" media="all" />
<!-- 960 Grid ( 12+16 cols) System for easy and flexible markups.-->
<link rel="stylesheet" type="text/css" href="files/codes/css/960.css" media="all" />
<!-- Default and template specific styles. -->
<link rel="stylesheet" type="text/css" href="files/codes/css/default.css" media="all" />
<!-- prettyPhoto jQuery plugin's CSS styles-->
<link rel="stylesheet" type="text/css" href="files/codes/css/prettyPhoto.css" media="all" />
<!-- Weird IE specific codes -->
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="files/codes/css/ie7.css" media="all" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="files/codes/css/ie8.css" media="all" />
<![endif]-->
</head>
In the bottom portion, weve linked two style sheet documents specifically for IE browsers. Weve placed them inside a conditional
comments block which only IE browsers understand.
19 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Open reset.css document in your text editor. Then copy the following into the document:
@charset "utf-8";
/* CSS Document */
/*
~"~"~ ICONIFY ~"~"~ XHTML Template by palpaldal
TABLE OF CONTENTS ------------------
1. Style resetting codes (using Eric Meyer's resetter)
http://meyerweb.com/eric/tools/css/reset/
v1.0 | 20080212
2. Default styles of some common XHTML tags/elements.
*/
/* ----------------- Resetting browser defaults ------------------- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, button,
table, caption, tbody, tfoot, thead, tr, th, td {
background: transparent;
border: 0;
font-size: 100%;
margin: 0;
outline: 0;
padding: 0;
vertical-align: baseline;
}
body{
background: #e7e7e7;
color: #7c7c7c;
font: normal 12px/18px Arial, Helvetica, sans-serif;
}
ol, ul{list-style: none;}
ol li, ul li{
display: inline;
line-height: 0;
}
blockquote, q{quotes: none;}
blockquote:before,
blockquote:after,
q:before,
q:after{
content: '';
content: none;
}
:focus{outline: 0;}
/* ----------------- Applying default styles to common XHTML elements ------------------- */
a{
color: #eaa000;
text-decoration: none;
}
a:hover, a:focus{border-bottom: 1px solid;}
abbr{
border-bottom: 1px dotted;
letter-spacing: 0.2em;
}
acronym{
border-bottom: 1px solid;
letter-spacing: 0.1em;
}
h1, h2, h3, h4, h5, h6{
color: #2e5bc3;
font: bold 100%/1.2 Arial, Helvetica, sans-serif;
margin: 18px 0;
}
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a{color: #2e5bc3;}
h1{font-size: 32px;}
h2{font-size: 28px;}
h3{font-size: 24px;}
h4{font-size: 20px;}
h5{font-size: 16px;}
20 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
h6{
font-size: 13px;
text-transform: uppercase;
}
p{
font-size: 12px;
line-height: 18px;
margin: 18px 0;
}
pre{
font-family: consolas, "Courier New", Courier, monospace;
font-size: 14px;
line-height: 18px;
}
blockquote{
font-size: 12px;
font-style: italic;
line-height: 18px;
margin: 18px 0;
padding-top: 6px;
}
blockquote+blockquote{
background: none;
padding: 0;
text-indent: 0;
}
cite{
display: block;
font-style: normal;
line-height: 18px;
margin: 18px 0;
text-align: right;
}
cite strong{display: block;}
strong,
b{font-weight: bold;}
em,
i{font-style: italic;}
del,
strike{text-decoration: line-through;}
small{font-size: .8em;}
big{font-size: 1.2em;}
code{
font-family: consolas, "Courier New", Courier, monospace;
padding: 2px 4px;
}
input[type="text"],
input[type="password"],
textarea{
background: #e7e7e7;
border: 1px solid #dbdbdb;
font-size: 12px;
line-height: 12px;
margin: 0;
padding: 8px 10px 7px;
}
input[type="text"]{
color: #666666;
font: normal 12px/1 Arial, Helvetica, sans-serif;
}
input[type="password"]{
color: #666666;
font: normal 12px/1 "Courier New", Courier, monospace;
}
textarea{
color: #666666;
font: normal 12px/18px Arial, Helvetica, sans-serif;
overflow: auto;
}
input[type="text"]:focus,
input[type="text"]:hover,
input[type="password"]:focus,
input[type="password"]:hover,
textarea:focus,
textarea:hover{
background-color: #dedede;
border-color: #bbbbbb;
}
button,
input[type="submit"],
input[type="button"],
input[type="reset"]{
background: #fcfcfc;
border: 1px solid #b6b6b6;
color: #7c7c7c;
21 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
cursor: pointer;
display: block;
font-size: 12px;
height: 32px;
line-height: 12px;
padding: 0 20px 3px 20px;
}
button:focus,
button:hover,
input[type="submit"]:focus,
input[type="submit"]:hover,
input[type="button"]:focus,
input[type="button"]:hover,
input[type="reset"]:focus,
input[type="reset"]:hover{
background-color: #b6b6b6;
color: #fff;
}
hr{
background: #cdcdcd;
border: none;
border-bottom: 1px solid #f6f6f6;
border-top: 1px solid #f6f6f6;
display: block;
padding-top: 1px; /* Chrome having trouble with height larger than 1px*/
height: 0;
margin: 18px 0;
}
/* tables still need 'cellspacing="0"' in the XHTML markup */
table{
border: 1px solid #cecece;
border-right: none;
border-top: none;
border-collapse: collapse;
border-spacing: 0;
}
table caption{
caption-side: top;
font-style: italic;
padding: 2px;
text-align: right;
}
td,
th{
border: 1px solid #cecece;
border-bottom: none;
border-left: none;
padding: 4px;
}
First, were declaring our character set UTF8 as the same weve used for our HTML.
In the resetting section, were resetting default browsers styles and positioning. Were also applying our default body and text colors
and details to the body selector. Now, if you preview your document in any browser youll notice that our theme is slowly coming to
life with our own colors and some styles were applying from reset.css file.
22 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Open default.css file in your text editor. Now copy paste the following into your default.css file.
@charset "utf-8";
/* CSS Document */
/*
~"~"~ ICONIFY ~"~"~ XHTML Template by palpaldal
TABLE OF CONTENTS ------------------
1. Common Theme Elements (usually inline elements)
2. Theme Structure
3. Pages Common Content's Styles
a. Header
b. Menu
c. Breadcrumbs
d. Footer
e. Sidebar
f. Pagination
4. Pagewise Styles
a.Home
b. Portfolio
i. Column 2
23 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
ii. Column 3
iii.Column 4
c. Blog
ii. Comments
iii.Comment Form
d. Contact
i. Contact Form
5. Others
*/
/* <<<<<<<<<< 1. Common Theme Elements (usually inline elements) >>>>>>>>>> */
/* <<<<<<<<<< 2. Theme Structure >>>>>>>>>> */
/* <<<<<<<<<< 3. Pages Common Content's Styles >>>>>>>>>> */
/* <<<<<<<<<< a. Header >>>>>>>>>> */
/* <<<<<<<<<< b. Menu >>>>>>>>>> */
/* <<<<<<<<<< c. Breadcrumbs >>>>>>>>>> */
/* <<<<<<<<<< d. Footer >>>>>>>>>> */
/* <<<<<<<<<< e. Sidebar >>>>>>>>>> */
/* <<<<<<<<<< f. Pagination >>>>>>>>>> */
/* <<<<<<<<<< 4. Pagewise Styles >>>>>>>>>> */
/* <<<<<<<<<< a.Home >>>>>>>>>> */
/* <<<<<<<<<< b. Portfolio >>>>>>>>>> */
/* <<<<<<<<<< a. Column 2 >>>>>>>>>> */
/* <<<<<<<<<< b. Column 3 >>>>>>>>>> */
/* <<<<<<<<<< c. Column 4 >>>>>>>>>> */
/* <<<<<<<<<< c. Blog >>>>>>>>>> */
/* <<<<<<<<<< i. Comments >>>>>>>>>> */
/* <<<<<<<<<< ii. Comment Form >>>>>>>>>> */
/* <<<<<<<<<< d. Contact >>>>>>>>>> */
/* <<<<<<<<<< i. Contact Form >>>>>>>>>> */
/* <<<<<<<<<< 5. Others >>>>>>>>>> */
Now our three main sections are floating in the center of the page. .container_16 is the grid 16 of grid960. The total width of all our
three sections is now exactly 940px. Our design, however, is 980px wide so were going to apply (left+right: 20+20)px padding around
our sections. Well also apply some other styles to our sections. Type these rules inside your default.css files 2. Theme Structure
section or copy and paste them.
/* <<<<<<<<<< 2. Theme Structure >>>>>>>>>> */
#header{
background: #f1f1f1;
border: 1px solid #cdcdcd;
-moz-border-radius-bottomleft: 10px;
-webkit-border-bottom-left-radius: 10px;
border-bottom-left-radius: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-bottom-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top: none;
padding: 0 10px;
margin-bottom: 20px;
}
#header .inner{
border: 1px solid #f9f9f9;
-moz-border-radius-bottomleft: 10px;
-webkit-border-bottom-left-radius: 10px;
border-bottom-left-radius: 10px;
-moz-border-radius-bottomright: 10px;
-webkit-border-bottom-right-radius: 10px;
border-bottom-right-radius: 10px;
border-top: none;
margin: 0 -10px;
24 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
padding: 0 20px;
}
#content{
background: #f1f1f1;
border: 1px solid #cdcdcd;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin-bottom: 20px;
margin-top: 20px;
padding: 0 10px;
}
#content .inner{
border: 1px solid #f9f9f9;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
border-radius: 10px;
margin: 0 -10px;
padding: 40px 20px;
}
#footer{
background: #f1f1f1;
border: 1px solid #cdcdcd;
-moz-border-radius-topleft: 10px;
-webkit-border-top-left-radius: 10px;
border-top-left-radius: 10px;
-moz-border-radius-topright: 10px;
-webkit-border-top-right-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
margin-top: 20px;
padding: 0 10px;
}
#footer .inner{
border: 1px solid #f9f9f9;
-moz-border-radius-topleft: 10px;
-webkit-border-top-left-radius: 10px;
border-top-left-radius: 10px;
-moz-border-radius-topright: 10px;
-webkit-border-top-right-radius: 10px;
border-top-right-radius: 10px;
border-bottom: none;
margin: 0 -10px;
padding: 1px 20px;
}
All the rules for these three sections are pretty much the same. To #header, were applying a background color and the outer border
color (get these color values from your design with the eye dropper tool). And .inner elements for the inner white glow. Check your
progress in your browser to make sure everything is being styled appropriately. Here our documents browser preview:
25 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
26 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
27 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
display: none;
left: 8px;
position: absolute;
top: 0px;
}
#header .top input[type="submit"]{
background: transparent url(../../images/srch-btn.png) 0 0 no-repeat;
border: none;
display: block;
font-size: 0;
height: 15px;
padding: 0;
position: absolute;
right: 4px;
text-indent: -999px; /* some browser shows 1px height texts like Safari even with font-size: 0 */
top: 4px;
width: 19px;
}
#header .top input[type="submit"]:focus,
#header .top input[type="submit"]:hover{background-position: -19px 0;}
#nav{padding: 20px 0;}
#logo a{border: none;}
OK, a summary of the most important code blocks or tricks, sequentially from top to bottom.
#header .top were using this element to apply the divider image.
#header .top li this applies a different text color for this block. And its large line-height will help our text stay in the middle of
the block.
#header .top li a overriding the default link elements styling and applying a unique style for this block.
#header .top li:last-child selecting the last child of #header .top element and zeroing out its margin for perfect positioning.
#header .top li:first-child a overriding the styling of #header .top first child.
#header .top form setting forms position to relative for its label to float appropriately .
#header .top legend hiding legend element from displaying
#header .top label were positioning the label to act like a field value for visitors to easily define why this field is for. By
default were hiding it, but well display it using JS.
#header .top input[type="submit"] for this button please slice and save our magnifier icon with the guideline shown in
image B 2bb.
28 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Were applying class names container_16 and clearfix to the div#nav element to properly position our #logo and #menu. Were
applying .grid_5 and .alpha to div#logo to give it a space equal to 5 grids and removing its left margins with the class .alpha. Were
also applying .grid_11 and .omega to the ul#menu to give it a space equal to 11 grids and removing its right margins with the class
.omega. Finally, we take care of the dropdown or multi-level menus. Well design and position menu and multi-level menus with CSS.
29 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Now slice and save your dropdown menu items arrow inside your files->images folder as shown in image B 2ca
Copy or type the following code inside your default.css files menu section.
/* <<<<<<<<<< b. Menu >>>>>>>>>> */
#menu{
padding: 16px 0 0 290px;
width: 350px;
z-index: 999;
}
#menu li{
color: #0f5193;
font-size: 14px;
font-weight: bold;
margin-left: 14px;
position: relative;
}
#menu li.active a,
#menu li a:focus,
#menu li a:hover{border-bottom: 1px solid #88afd5;}
#menu>li.dropdown>a{
border: none;
background: transparent url(../../images/drop-arrow.png) right center no-repeat;
padding-right: 10px;
}
#menu>li.dropdown.active>a{border-bottom: 1px solid #88afd5;}
#menu li a{color: #0f5193;}
#menu ul{
background: #e4e4e4;
border: 1px solid #b7b7b7;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
border-radius: 4px;
position: absolute;
top: -999px;
margin: 0;
padding: 1px 11px;
left: 0;
width: 100px;
z-index: 999;
}
#menu ul li{
background: #d5d5d5;
display: block;
font-size: 12px;
font-weight: normal;
line-height: 1.6;
margin: 0 -10px;
padding: 4px 10px 0;
}
30 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Note: our multi-level menus have extra margins on their left. Everything will be fine when we apply the superfish jQuery dropdown
menu plugin a little later.
31 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
The styles are very simple. #sliders background color needs to be shown as the dark inner glow color. Well achieve this by applying
a 1px padding inside the #slider element. We apply position: relative to our #cyclePager so that it floats inside the #slider and on top
of the slides. a.activeSlide is a class of current active slide, jQuery cycle plugin will automatically apply this class.
32 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
</li>
<li <strong>class="grid_4"</strong>>
...
</li>
<li <strong>class="grid_4"</strong>>
...
</li>
<li <strong>class="grid_4 omega"</strong>>
...
</li>
</ul><!-- end of .promo-col-4 -->
Here were applying a width to every column equal to grid 4 and clearing the floating bug with the class clearfix.
Copy or type the following styles after your #slider code inside the a.Home section.
.promo-col-4{margin: 30px 0 40px;}
.promo-col-4 li{
display: block;
overflow: hidden;
}
.promo-col-4 li img{
display: block;
float: left;
margin-right: 10px;
}
.promo-col-4 li h5{margin: 4px 0;}
At this point your document should to render in browsers like the image shown below:
..and copy this CSS rule after your #promo-col-4 codes inside a.Home section.
.promo-col-3{margin: 40px 0;}
We have two borders in our images: an inner glow and a darker border. We can apply these styles directly from Photoshop but its
far more flexible to achive the effect using CSS. Well apply the inner glow from Photoshop and apply a class of .border to our
images for those two borders. As an example, follow these guidelines on how I slice, apply the styles, then save them.
33 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Our .promo-col-3 images dimensions are 300140. Well start by creating a new document in Photoshop measuring 298x138px
(were leaving 1px from around image to fill those 1px with CSS). Now place your image, reduce its size by using transform. Hit
Ctrl+A to select the entire canvas, goto Image->Crop. Now copy the layer styles from any one of our images, now apply that layer style
to this new image. After doing all that all you should see the glow effect. Now save your image in your assets folder. Apply the same
techniques for our future images using the following image as a reference.
Now apply a class of .border to the images, and paste this code inside your default.css files 1. Common Theme Elements (usually
inline elements) section.
/* <<<<<<<<<< 1. Common Theme Elements (usually inline elements) >>>>>>>>>> */
.border{border: 1px solid #b9b9b9;}
The Testimonial
Slice and save testi-arrow.png image inside your files->images folder as shown in image B 2db.
Paste the following code after your #promo-col-3 codes inside the a.Home section.
.testimonial{margin: 40px 0;}
#content .testimonial .inner{
border: 1px solid #f3f3f3;
-moz-border-radius: 0;
-webkit-border-radius: 0;
border-radius: 0;
padding: 0;
position: relative;
margin: 0;
}
.testimonial blockquote{
background: #e5e5e5;
34 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Here we are..
>.testimonial blockquote setting the background and inner border color of the testimonial box.
Copy the following rules after your .testimonial codes inside a.Home section.
#recentProjects .bar{
border: 1px solid #e5e5e5;
35 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
margin: 0 0 18px 0;
}
#recentProjects h5{
color: #7c7c7c;
background: #f3f3f3;
border: 1px solid #f9f9f9;
margin: 0;
height: 38px;
text-align: center;
font-size: 14px;
line-height: 36px;
}
Weve just finished designing and positioning our #content sections elements. In the browser our #recentProjects element should
to render perfectly as shown below.
Paste the following code inside your default.css files d. Footer subsection.
/* <<<<<<<<<< d. Footer >>>>>>>>>> */
#footer .top{
background: transparent url(../../images/bdr-bg.png) left bottom repeat-x;
overflow: hidden;
padding-bottom: 33px;
width: 940px;
}
#twitter{
background: transparent url(../../images/twitter-bird.png) 0 center no-repeat;
margin-top: 30px;
padding-left: 50px;
width: 570px;
}
#twitter h2,
#twitter .profileLink{display: none;}
#twitter li{
display: block;
36 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
line-height: 18px;
}
.social{
background: transparent url(../../images/v-bdr-bg.png) 1px 0 repeat-y;
height: 32px;
margin: 30px 0 0 0;
padding: 0 0 0 10px;
overflow: hidden;
}
.social li{
display: block;
float: left;
line-height: 18px;
margin-right: 10px;
}
.social li:last-child{margin-right: 0;}
.social h5{
color: #7c7c7c;
font-size: 14px;
font-weight: normal;
line-height: 32px;
margin: 0 0 0 62px;
width: 70px;
}
.social a{border: none;}
Here we are..
At this point our document should to render as follows. Please note that our twitter section is empty as weve not applied any scripts
to our document.
37 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Paste the following code after your .top rules inside d. Footer section.
#footer .content{
margin-top: 30px;
width: 940px;
overflow: hidden;
}
#footer .content .grid_4{
background: transparent url(../../images/v-bdr-bg.png) right top repeat-y;
width: 287px;
padding-bottom: 500px;
padding-right: 20px;
margin-bottom: -500px;
}
#footer .content li:last-child{
padding-right: 0;
background: none;
width: 286px;
}
#footer .content h5{
color: #7c7c7c;
margin-top: 0;
}
#footer .blogList li{
display: block;
line-height: 18px;
margin-bottom: 20px;
}
#footer .blogList li:last-child{margin: 0;}
#footer .blogList img{
display: block;
float: left;
margin: 0 10px 4px 0;
}
#footer .blogList h5{
38 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
color: #2e5bc3;
margin: 0;
}
#footer .blogList p{margin: 10px 0;}
#toTop{
background: transparent url(../../images/to-top.png) 0 0 no-repeat;
border: none;
cursor: pointer;
display: block;
height: 10px;
margin: 20px auto;
width: 11px;
}
#toTop:focus,
#toTop:hover{background-position: -11px 0;}
#footer .content .grid_4 overrides the default .grid_4 width and applies some other styles.
For #toTops arrow slice, save the arrow from our Photoshop file as shown in image B 2eb.
Copy the following code inside your default.css files 1. Common Theme Elements (usually inline elements) section.
/* <<<<<<<<<< 1. Common Theme Elements (usually inline elements) >>>>>>>>>> */
.border{border: 1px solid #b9b9b9;}
.list{margin: 18px 0;}
.list li{
display: block;
line-height: 18px;
margin-bottom: 4px;
}
.list li a{color: #7c7c7c;}
.list li a:focus,
.list li a:hover{color: #eaa000;}
.btn{line-height: 18px;}
You may have noticed that weve applied a class of .list to our Categories item inside .content section. This .list is a common inline
class and we can use it to display other list items in any other pages. And our final footer element looks like this:
39 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Final Touches
Weve successfully designed our homepage, and our theme works fine in all the modern browsers except IE. For IE, we need some
special CSS since they dont support some CSS pseudo classes. Were going to write some IE specific code to handle these issues.
If you preview your document by this point in IE8 then youll find this misrendering:
40 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
To solve these misrenderings copy or type the following rules inside your ie8.css file.
/* as IE8 having trouble supporting CSS pseudo class ":last-child" */
#header .top li+li+li+li{margin: 0;}
#footer .inner .content li+li+li{
padding-right: 0;
background: none;
width: 286px;
}
.social li+li+li+li+li{margin-right: 0;}
.popularPost ul li+li{margin-right: 0;}
If you preview your document in IE7 youll find some browser misrenderings as in IE8 + more
To solve these please copy or type the following rules inside your ie7.css file.
/* as IE7 having trouble supporting CSS pseudo class ":last-child" */
#header .top li+li+li+li{margin: 0;}
#footer .inner .content li+li+li{
padding-right: 0;
background: none;
width: 286px;
}
.social li+li+li+li+li{margin-right: 0;}
#menu ul li:last-child{padding-bottom: 6px;}
#footer .content .grid_4{
padding-bottom: 0;
margin-bottom: 0;
}
hr{
background: #cdcdcd;
border: none;
border-bottom: 1px solid #f6f6f6;
border-top: 1px solid #f6f6f6;
display: block;
padding: 0;
height: 3px;
margin: 18px 0;
}
.popularPost ul li+li{margin-right: 0;}
#commentForm input[type="text"],
#commentForm textarea,
#contactForm input[type="text"],
#contactForm textarea{margin-left: -80px;}
Note: were targeting some elements which dont exist, yet. Well use these selectors/elements later.
41 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="author" content="Nuruzzaman Sheikh(palpaldal)" />
<meta name="description" content="A brief description of this website or your business." />
<meta name="keywords" content="keywords, or phrases, suited with each particular page, are best" />
<title>ICONIFY :: Welcome</title>
<!-- Favorites icon -->
<link rel="shortcut icon" href="assets/favicon.ico" />
<!-- CSS Files -->
<!-- Resetting all default browser markups and styles.-->
<link rel="stylesheet" type="text/css" href="files/codes/css/reset.css" media="all" />
<!-- 960 Grid ( 12+16 cols) System for easy and flexible markups.-->
<link rel="stylesheet" type="text/css" href="files/codes/css/960.css" media="all" />
<!-- Default and template specific styles. -->
<link rel="stylesheet" type="text/css" href="files/codes/css/default.css" media="all" />
<!-- prettyPhoto jQuery plugin's CSS styles-->
<link rel="stylesheet" type="text/css" href="files/codes/css/prettyPhoto.css" media="all" />
<!-- JavaScript Files -->
<!-- jQuery JavaScript Library Scripts -->
<script src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/codes/js/jquery-1.4.2.min.js"></script>
<!-- cycle plugin jQuery library -->
<script src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/codes/js/jquery.cycle.all.min.js"></script>
<!-- prettyPhoto library -->
<script src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/codes/js/jquery.prettyPhoto.js"></script>
<!-- This codes starts/initializes all js functionalities throughout this template. It's also some mini third party js libraries. -->
<script src="http://d3pr5r64n04s3o.cloudfront.net/tuts/188_iconify/tutorial-coding-phase/files/codes/js/init.js"></script>
<!-- Weird IE specific codes -->
<!--[if lt IE 8]>
<link rel="stylesheet" type="text/css" href="files/codes/css/ie7.css" media="all" />
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="files/codes/css/ie8.css" media="all" />
<![endif]-->
</head>
Now open your init.js file and copy the source from the following plugins:
jQuery.easing plugin
jQuery.scrollTo plugin
jQuery.supersubs dropdown menu plugin
jQuery.superfish dropdown menu plugin
jQuery.twitter plugin
jQuery.scrollToTop plugin
custom jQuery.tinyValidator validates form fields
Theme Script initialization function/codes
All the above libraries are third party. Were combining them into a single file for fewer HTTP requests. Among them tinyValidator
is a mini validation plugin which Ive developed. Now were going to actually start/initialize our scripts. Copy the following code
inside your init.js files Site Initialization JavaScript Codes section.
/* <<<<<<<< Site Initialization JavaScript Codes >>>>>>>> */
;(function($){
$(document).ready(function(){
$('.border').parent('a').css('border', 'none');
});
/* jQuery ScrollToTop plugin */
$(function() { $("#toTop").scrollToTop({speed:1000,ease:"easeInOutQuad",start:600}); });
/* cycle plugin function declarations using 'cycle.js' jquery plugin */
$(document).ready(function(){
if ($('#cycle').length > 0){
$('#cycle').cycle({
fx: 'scrollLeft',
speed: 500,
timeout: 8000,
randomizeEffects: false,
easing: 'easeInOutQuad', //jquery.easing library/plugin is required for this functionality
next: '',
prev: '',
pager: '#cyclePager',
cleartypeNoBg: true
});
}
});
/* altering search form label and using it's label as field's value */
$(document).ready(function(){
42 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Were placing all our site initialization codes inside an anonymous function.
In the first block were removing hover state border from images with a class .border.
Initializing jQuery scrollToTop plugin with our #toTop element.
Making sure #cycle is available and then initializing the cycle plugin.
Altering search form label and using its label as fields value.
Initializing dropdown menu function using superfish.js and supersubs.js jquery plugin
Initializing twitter plugin. You can show your tweet by only changing the userName variable.
Conclusion
Phew! Weve finsihed the most substantial part of our coding phase. You may notice that some practices or techniques have been
exaggerated, but these were only for demonstration purposes and little else. Well work on finishing up this theme in the next part.
Thank you so much for reading!
By Nuruzzaman Sheikh
43 of 44 09/09/2013 03:55 PM
Design And Develop A Complete Website (A Tuts+ Mini Series,... http://webdesign.tutsplus.com/tutorials/complete-websites/de...
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
44 of 44 09/09/2013 03:55 PM