How to Convert PSD to HTML Easily: A Complete Beginner’s Guide

Share on facebook
Share on twitter
Share on linkedin
Share on whatsapp

In this article

In this tutorial, you will learn how to convert a PSD template to HTML in a few quick and easy steps. I’m not really into coding – I’m more of a design person and this is my first coding tutorial, so I’m pretty excited to show you this. I will try my best to guide you through the whole process. We will be coding this from scratch and hopefully, by the end, you will have an awesome and fully functional HTML page for a corporate agency website.

When converting PSD to HTML/CSS we will need to go back and forth in Photoshop (or any other image editing tool) to measure the sizes, distance, and colors. So make sure you open up the PSD file in Adobe Photoshop.

Of course, you’ll also need your favorite code editor and debugging tools. I used Intype as my text editor. For debugging tools, I recommend Web Developer Toolbar and Firebug. It is important to test our code using different browsers every step of the way so that we can keep on track of our code. I used CSS3 styles in this tutorial, which should work in Chrome and Firefox.

Getting the Files Ready

converting psd to html tutorial

You will need to create a directory folder and inside of it, you should have an /images directory for images and a /jsdirectory for JavaScript. I placed the CSS file in the root folder including the HTML file.

Also, we need to export the images to be used in the PSD file. For example the Logo, you will need to select the layer from the layers panel, copy and paste it in a different document, and CTRL + ALT + SHIFT + S in order to save for the web and devices. The appropriate file type for the logo should be .png. But if you’re tired of doing this, you can just download the files and use the images I already exported.

Simple Starter Layout

To build our HTML layout, we should first analyze our design by looking at the Photoshop layout and identify the sections that are unique.

Background: Notice that the background is white.

Header: In this section, notice the green line at the top which covers the whole screen. In order to do this, we need to wrap the header with another container. The header contains a logo, call to action, navigation, and search.

Slides: For the slider, we will be using SlideJS

Service: This section contains 2 columns for web design and vector design. You will notice the above sections (slides, services, and media) are positioned in the center. So we will wrap them with a div and name it container.

Widget: This section is divided into 3 columns for links, blog, and location. Also, you will notice it is covered with a gray dotted pattern that covers the whole screen.

Here is the image of the overall markup that we have done.

converting psd to html tutorial

Now, based on these notes, we create the following HTML layout from the PSD.

<!doctype HTML>
	<html lang="en">
	<head>
	  <meta charset="utf-8">
	  <title>Burnstudio</title>
	  <link rel="stylesheet" href="style.css">
	</head>
<body>
	<div id="header-wrap">
		<header>
			header content goes here
		</header>
	</div><!-- end header wrap -->

	<div id="container">
		<div id="slides">
			slides content goes here
		</div><!-- end slides -->

		<div id="service">
			service content goes here
		</div><!-- end service-->

		<div id="media">
			media content goes here
		</div><!-- end media -->
	</div> <!--! end container -->

	<div id="widget-wrap">
		<div id="widget">
			widget content goes here
		</div><!-- end widget -->
	</div> <!--! end widget-wrap -->

	<div id="client-wrap">
		<div id="client">
			widget content goes here
		</div><!-- end client -->
	</div> <!--! end client-wrap -->

	<footer>
		footer content goes here
	</footer>
</body>
</html>

Notice that the naming of the divs in every section is based on the naming we did earlier when we analyzed the PSD layout. Also, note that this layout is a fixed width of 960px. I know it would be better if we used a CSS framework for this project. But as I said earlier, we will do this from scratch.

Working on the Header Section

Now let’s focus more on the header section. We will mark up the HTML elements that can be found in this section.

<h1><a href="index.html" title="burnstudio">Burnstudio</a></h1>
<div id="call">
	<h3>(012) 345 6789</h3>
	<h4>Call us <strong>now</strong></h4>
</div><!-- end call -->
<nav>
	<ul>
		<li><a href="#" title="">Home</a></li>
		<li><a href="#" title="">Services</a></li>
		<li><a href="#" title="">About Us</a></li>
		<li><a href="#" title="">Testimonials</a></li>
		<li>
			<div>
				<input type="text" name="search" placeholder="search" />
				<input type="submit" name="search" value="go"/>
			</div>
		</li>
	</ul>
</nav>

In the above HTML, I just followed what I saw in Photoshop. The first element is the Logo. Since the logo is clickable I added an <a> tag inside the h2, followed by the call number which is wrapped in a div with an id of call. Lastly, I created a <ul> list which contains links and the search.

Now let’s add the CSS as follows:

All CSS should be added in the style.css file. Also, make sure you just copy the CSS reset which I provided in the resources and place it in style.css file.

body{
	background: #fff;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 13px;
}

/* FONT STYLES*/
h3{
	font-size: 24px;
	font-family: Helvetica, Arial, sans-serif;
	color: #333333;
	margin-bottom: 25px;
}
h4{
	margin-bottom: 25px;
	font-size: 18px;
	font-family: Helvetica, Arial, sans-serif;
}
h5{
	font-size: 14px;
	font-family: Helvetica, Arial, sans-serif;
}
p{
	font-size: 13px;
	color: #555555;
	line-height: 18px;
}
a, a:link, a:visited{
	text-decoration: none;
	outline: none;
}
.green{
	color: #509743;
}
.white{
	color: #fff;
}
strong{
	font-weight: bold;
}
/* END FONTS STYLES */

In the above CSS, since we have reset styles we need to style our text formats. I know that we used a different font for our headings and I don’t think Google fonts support Kozuka Gothic. But for now, we will replace it withHelvetica. Notice also I added the classes green and white, this will be used when we style green or white text that can be seen in the design.

When you test it you will have something that looks like the screenshot below.

converting psd to html tutorial

/* HEADER */
#header-wrap{
	border-top: 10px solid #4d9543;
	padding-top: 40px;
}
header{
	width: 960px;
	margin: 0 auto;
	padding: 0;
}
header h2 a{
	display: block;
	text-indent: -999999px;
	background: url(images/logo.png) no-repeat;
	width: 214px;
	height: 77px;
	float: left;
	margin-bottom: 40px;
}

#call{
	float: right;
	border-right: 1px solid #c8c8c8;
	padding-right: 25px;
	margin-top: 20px;
}
#call h3{
	margin: 0;
}
#call h4{
	text-align: right;
	margin: 0;
}

nav{
	clear: both;
	width: 960px;
	height: 50px;
	-moz-border-radius: 30px;
	-webkit-border-radius: 30px;
	background-color: #3b7c33; /* Fallback */
	border-radius: 30px;
	/* Safari 4+, Chrome 1-9 */
	background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#5fae53), to(#3b7c33));
	/* Safari 5.1+, Mobile Safari, Chrome 10+ */
	background-image: -webkit-linear-gradient(top, #5fae53, #3b7c33);
	/* Firefox 3.6+ */
	background-image: -moz-linear-gradient(top, #5fae53, #3b7c33);
	/* IE 10+ */
	background-image: -ms-linear-gradient(top, #5fae53, #3b7c33);
	/* Opera 11.10+ */
	background-image: -o-linear-gradient(top, #5fae53, #3b7c33);
	border: 1px solid #336c2b;
}

nav ul li{
	float: left;
	border-right: 1px solid #336c2b;
	border-left: 1px solid #78c368;
}
nav ul li.home{
	border-left: none;
	text-indent: -9999px;
	background: url(images/home.png) no-repeat 50% 50%;
}

nav ul li.last{
	border-left: none;
	border-right: none;
	float: right;
	margin-right: 20px;
}
nav ul li a{
	display: block;
	padding: 0 30px;
	height: 50px;
	line-height: 50px;
	font-size: 15px;
	color: #fff;
	text-shadow: 0 1px 0 #387031;
}
nav ul li a:hover{
	background: #5fae53;
}

nav ul li.home a:hover{
	-webkit-border-top-left-radius: 30px;
	-webkit-border-bottom-left-radius: 30px;
	border-top-left-radius: 30px;
	border-bottom-left-radius: 30px;
	background: #5fae53 url(images/home.png) no-repeat 50% 50%;
}
nav ul li div input[type=text]{
	-webkit-border-radius: 20px;
	-moz-border-radius: 20px;
	background: #4b9241;
	border-left: none;
	border-right: none;
	border-bottom: 1px solid #5ead52;
	border-top: 1px solid #346d2c;
	color: #fff;
	text-shadow: 0 1px 0 #387031;
	padding: 5px 0 5px 20px;
	width: 200px;
}
nav ul li div input[type=text]:focus{
	outline: none;
}

/* TO STYLE PLACE HOLDER */
::-webkit-input-placeholder {
   color: #fff;
}
:-moz-placeholder {
   color: #fff;
}

nav ul li div input[type=submit]{
	background: url(images/search.png) no-repeat 50% 50%;
	border: none;
	text-indent: -999999px;
	margin-left: 15px;
	height: 50px;
	width: 16px;
}

/* END HEADER */

In the above CSS, I styled header-wrap with a 10px green border. Since a div is styled in a block display by default, this will fill the whole width of the screen. Then I centered the header with margin: 0 auto. Next, I styled the Logo with a fixed width and height. I also floated it on the left. For the Call, I floated it right and apply a 1px gray border also a 25px padding from the right. Note that to get this value you need to go back to Photoshop and use the Ruler Tool(I) to measure the distance. Since I styled the h3 and h4 with a 25px bottom margin in our base text format we need to reset it and change it to 0. This will make the h4 and h3 in the call section back to normal.

Next, I styled the navigation with a fixed width, height, and a gradient, I applied a clear both to clear the above floating elements logo & call. All li are floated left except for the last li element. Also, it has a left and right border except for the home. There is no left border and for the last, there is no right border. All a’s are styled with a 30px padding from left and right 0 for top and bottom, a height of 50, a text-shadow, a line-height of 50 to make it center vertically. For the class home, I pushed out the text and replace it with the home icon. Since the corner is rounded we need to specify another style hover for the home button that’s what I did below the a: hover.

Lastly, I styled the search input with a rounded radius, a green background, dark border on top and light border at the bottom. Also to target placeholder attribute refer to the CSS which I comment to style place holder this is a part of css3 property.

Before previewing this to IE lower versions make sure to copy and paste the code below in the header section of our HTML file. This will enable HTML5 elements to work in older IE browsers.

<!--[if IE]>
	<script type="text/javascript">
	(function(){
	var html5elmeents = "address|article|aside|audio|canvas|command|datalist|details|dialog|figure|figcaption|footer|header|hgroup|keygen|mark|meter|menu|nav|progress|ruby|section|time|video".split('|');
	for(var i = 0; i < html5elmeents.length; i++){
	document.createElement(html5elmeents[i]);
	}
	}
	)();
	</script>
	<![endif]-->

Now our layout should look like this.

converting psd to html tutorial

Working on the Slider Section

Now let’s add the content inside the slides element, here’s the HTML.

<div>
	<div>
		<img src="http://www.1stwebdesigner.com/wp-content/uploads/2012/09/slide1.png" alt="slide1" />
		<div>
			<h1>Artthatworks 1 dolor sit amet, consectetur adipiscing elit.</h1>
			<p>Vestibulum a diam lorem. Fusce viverra commodo rhoncus. Nam ipsum magna, faucibus non semper et, vestibulum quis arcu. Nulla in tellus eu nunc cursus scelerisque ac nec nibh.</p>
			<p><a href="#">read more</a></p>
		</div>
	</div>

	<div>
		<img src="http://www.1stwebdesigner.com/wp-content/uploads/2012/09/slide1.png" alt="slide1" />
		<div>
			<h1>Artthatworks 2 dolor sit amet, consectetur adipiscing elit.</h1>
			<p>Vestibulum a diam lorem. Fusce viverra commodo rhoncus. Nam ipsum magna, faucibus non semper et, vestibulum quis arcu. Nulla in tellus eu nunc cursus scelerisque ac nec nibh.</p>
			<p><a href="#">read more</a></p>
		</div>
	</div>

	<div>
		<img src="http://www.1stwebdesigner.com/wp-content/uploads/2012/09/slide1.png" alt="slide1" />
		<div>
			<h1>Artthatworks 3 dolor sit amet, consectetur adipiscing elit.</h1>
			<p>Vestibulum a diam lorem. Fusce viverra commodo rhoncus. Nam ipsum magna, faucibus non semper et, vestibulum quis arcu. Nulla in tellus eu nunc cursus scelerisque ac nec nibh.</p>
			<p><a href="#">read more</a></p>
		</div>
	</div>
</div><!-- end slies container -->

In the above HTML markup I added a class slides_container this will hold our slides elements which are wrapped by a div that contains an image, a div class of slides-right that holds the slide title, info, and read more link. Also, I added a class for the heading slide-heading, paragraph info, and read more. This will be helpful since we will repeat the HTML code 3 times and they will have the same styles if we add the CSS later.

Now let’s style all the elements. Here’s the CSS.

#container{
	width: 960px;
	margin: 0 auto;
}
/* SLIDES */
#slides{
	position: relative;
	margin-top: 40px;
}
.slides_container{
	height: 315px;
}
.slide-right{
	position: absolute;
	top: 0;
	left: 385px;
}

.slide-heading{
	background: url(images/slide-heading.png) no-repeat;
	width: 494px;
	height: 68px;
	color: #fff;
	font-size: 24px;
	padding-top: 20px;
	padding-left: 80px;
	margin-top: 35px;
	margin-bottom: 30px;
}
.slide-right .info{
	width: 395px;
	margin-bottom: 20px;
	margin-left: 155px;
}
.slide-right .readmore{
	margin-left: 155px;
}
.readmore{
	font-style: italic;
	text-decoration: none;
	color: #509743;
	padding-left: 15px;
	background: url(images/more.png) no-repeat 0 50%;
}
.readmore:hover{
	color: #c8c8c8;

}
.pagination{
	position: absolute;
	bottom: 25px;
	left: 25px;
	z-index: 99;
}

ul.pagination li{
	float: left;
	margin-right: 10px;
	background: url(images/pagination.png) no-repeat;
	background-position: top;
	width: 14px;
	height: 15px;
}
ul.pagination li.current{
	background-position: bottom;
}
ul.pagination li a{
	display: block;
	text-indent: -999999px;
}

a.next{
	position: absolute;
	right: 25px;
	bottom: 30px;
	display: block;
	width: 7px;
	height: 13px;
	background: transparent url(images/prev-next.png) no-repeat;
	background-position: top right;
	text-indent: -9999px;
}
a.prev{
	position: absolute;
	right: 50px;
	bottom: 30px;
	display: block;
	width: 7px;
	height: 13px;
	background: transparent url(images/prev-next.png) no-repeat;
	background-position: top left;
	text-indent: -9999px;
}
a.next:hover{
	background-position: bottom right;
}
a.prev:hover{
	background-position: bottom left;
}
/* END SLIDES*/

In the above CSS since slides, service and media are wrapped with the container div, we will style this first to make them centered. Next, slide’s position is set to relative to make it the parent element. This is helpful so that we can position the inside elements prev, next, and pagination absolutely which are auto-generated by the JavaScript. For the slides_container I gave it a fixed height of 315px which is equal to the height of the slider image. For the slide-right which contains the heading, info and read more, all positioned absolutely, 0 out top, and pushed it 385px from left.

For the slide-heading I gave it a fixed width and height equal to the background image, and gave it a padding to make the text align properly, also a margin to give a space and align it correctly. For .info I gave it a fixed width with margin to align it. For .readmore first I gave it a separate margin style since only the slider readmore has this and all of the readmore links in the layout has no margins from left. Then followed by the readmore styling which has a green color with background arrow and a gray hover.

For the pagination, prev, and next buttons this is auto-generated by the JavaScript in order to style this first we need to identify what is the tag or the applied html class attribute. To do this you need to used the Firebug tool if you’re using Firefox, if you’re using Chrome just right click to the element and click Inspect Element a dialog will appear and you can see there what element is being used.

Now that you know the element, we will target it in the CSS. For the Pagination I positioned it absolutely, placed it 25px from the bottom and left, also I applied z-index 99px – this will make the pagination right on the very top over the other elements. If werre not going to apply this notice that it is not clickable because the image is on top of the pagination itself. Then I floated the pagination li elements to left, gave it a right margin of 10px, added a background image with a fixed width and height. I positioned the background by default to top since the normal state image is on top, for the current or the active state we will going to reverse the positioning from top to bottom and lastly display it as a block level element and hide the text. For the .next and .prev pretty much the same we did in pagination but this time it is positioned to the right. Noticed the prev-next.png on the left side this contains the image of prev button and on the right side this contains the image of the next button. I positioned the .nextimage to top right, .prev positioned to top-left, and for the hover just change the top to bottom.

Now let’s add the required jQuery script in the header. Copy the slides.min.jquery.js file from the /sourcedirectory and paste it in our /js directory.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
 <script src="js/slides.min.jquery.js"></script>

Finally, we need to add the JavaScript code that will allow the slider to work on our layout. You should add this script just before the. Here’s the JavaScript.

<script>
		$(function(){
			$('#slides').slides({
				preload: true,
				generateNextPrev: true,
			});
		});
</script>
Now our layout should look like this.

<img class="alignnone size-full wp-image-10720" src="https://cyberpro.co.ke/wp-content/uploads/2020/09/burnstudiov2-convert-img-14.jpg" alt="converting psd to html tutorial" width="570" height="318" />
<h3>Working on the Services Section</h3>
Now let’s add the content inside the <strong>service</strong> element. Here’s the HTML.


<div id="web">
		<img src="images/web.png" />
		<h3>Web <strong><span>Design</span></strong></h3>
		<p>Nunc viverttra erat et turpis viverra pellentesque. Maecenas ullamcorper, nibh tristique ullamcorper lacinia, tellus nisi blandit elit, id pulvinar tortor.</p>
		<p><a href="#">read more</a></p>
	</div><!-- end web -->

	<div id="vector">
		<img src="images/vector.png" />
		<h3>Vector <strong><span>Design</span></strong></h3>
		<p>Nunc viverttra erat et turpis viverra pellentesque. Maecenas ullamcorper, nibh tristique ullamcorper lacinia, tellus nisi blandit elit, id pulvinar tortor.</p>
		<p><a href="#">read more</a></p>
	</div><!-- end vector -->

I created a unique div id web and vector which contains the same elements such as an image, headings, paragraphs and readmore link. In the heading you can see I added a span and applied a class of green since the heading is combined with different colour. For the read more link we apply the same class we did in the slider area.

Now let’s style all the elements. Here’s the CSS.

/* SERVICE */
#service{
	margin: 40px auto;
	height: 253px;
	padding-top: 30px;
	background: url(images/service-bg.jpg) no-repeat;
}

#web{
	float: left;
	width: 450px;
	padding-left: 30px;
}
#web p{
	width: 260px;
	margin-bottom: 20px;
}
#web img{
	float: right;
	margin-right: 50px;
}
#vector{
	float: right;
	padding-left: 30px;
	width: 450px;
}

#vector p{
	width: 260px;
	margin-bottom: 20px;
}
#vector img{
	float: right;
	margin-right: 50px;
}
/* END SERIVCE*/

I styled the service div 40px from above to bottom and added an auto left and right, I also added a height that is equal to the background image. For the web div I floated it to the left and gave it a 50% width of the parent div, the same with the vector div but floated to the right. For the paragraph I gave it a fixed width with a margin, for the image I floated it right and give it a right margin, pretty much the same on vector image and text.

Now our layout should look like this.

converting psd to html tutorial

Working on the Media Section

Now let’s add the content inside the media element. Here’s the HTML.

<div id="media">
	<div id="video">
		<h4>Quick <strong>Video Tour</strong></h4>
		<h5>How we Design our works!</h5>
		<a href="#"><img src="images/play.png" alt="play" /></a>
	</div>

	<div id="twitter">
		<h4>Twitter <strong><span>Feed</span></strong></h4>
		<p>Mashable Video: Principal Resigns After Allegedly Posing as a Student on Facebook -<a href="#">http://on.mash.to/IVYWYJ</a></p>
		<p>9 hours ago</p>
	</div>

	<div id="facebook">
		<h4>Like Us On <strong><span>Facebook</span></strong></h4>

	</div>
</div><!-- end media -->

I created 3 different sections: video div which contains text headings h4, h5 and a clickable image for play button, twitter div which contains a heading and a paragraph, lastly a facebook div which contains a heading and if you wish to add your widget you can add it by going to Facebook plugins. Also, I added a class group on the media div. I’ll show you what that does when we move on to the CSS.

Now let’s style all the elements. Here’s the CSS.

/* MEDIA  */

#media{
	margin: 0 auto;
}
#video{
	width: 302px;
	padding-top: 20px;
	float: left;
	margin-right: 58px;
	background: transparent url(images/video-bg.png) no-repeat;
	height: 225px;
}
#video h4{
	margin: 0;
}
#video h4, #video h5{
	text-align: center;
	color: #fff;
	text-shadow: 0 1px 0 #387031;;
}

#video .play{
	float: right;
	margin-top: 5px;
}

#twitter{
	width: 285px;
	height: 180px;
	float: left;
	margin-right: 30px;
	background: transparent url(images/twitter-bg.png) no-repeat;
	background-position: bottom;
	padding: 0 0 20px 0;
}
#twitter p{
	padding: 0 20px;
}
#twitter .time{
	font-size: 11px;
	font-style: italic;
	color: #999999;
	margin-top: 15px;
}

a.t-link{ color: #6767c9; text-decoration: none; }
a.t-link:hover{ text-decoration: underline; }

#facebook{
width: 285px;
float: right;
}

/* END MEDIA*/

/* CLEAR FIX */
.group:after {
  content: "";
  display: table;
  clear: both;
}
/* END FIX */

I styled the video div with a fixed width and height of 302px x 225px, gave it padding, floated it to the left and lastly added a background image. I styled h4 and h5 centred and added a dropshadow, for the play button which has a class of .play I floated it to the right and added a margin to position it on the right. For twitter div I gave it a fixed width and height of 258px by 180px and added a background image positioned in bottom, also I gave the .timewith a smaller font and lighter caller, also for the a.t-link which has a blue color. For facebook this is the same to twitter heading and floated to right.

The purpose of the group class is to force the element to self-clear its children a.k.a clearfix. What this means is the media is the parent element which holds child elements inside of it that are floating left this are video, twitterand facebook. The media element doesn’t determine it’s height when we apply that clearfix hack this will identify the automatically identify the maximum height of the child element.

Now our layout should look like this.

converting psd to html tutorial

Working on the Widgets Section

<div id="widget-wrap">
<div id="widget">
	<div id="links">
		<h4>Other <strong>Links</strong></h4>
		<ul>
			<li><a href="#">www.example.com</a></li>
			<li><a href="#">www.1stwebdesigner.com</a></li>
			<li><a href="#">www.labzip.com</a></li>
			<li><a href="#">www.samplelink.com</a></li>
			<li><a href="#">www.outgoinglink.com</a></li>
			<li><a href="#">www.link.com</a></li>
		</ul>
	</div>

	<div id="blog">
		<h4>Latest From The <strong>Blog</strong></h4>
		<img src="images/blog.png" alt="blog" />
		<p>Maecenas iaculis lorem vel dui vulputate non consequat mi congue.</p>
		<p>05.30.2012</p>
		<p><a href="#">read more</a></p>
	</div><!-- end blog -->

	<div id="location">
		<h4>Our <strong>Location</strong></h4>
		<img src="images/map.png" alt="map" />
		<p>123 unknown street, address
		</br> 8600 Philippnes</p>
	</div><!-- end location -->
		</div><!-- end widget -->
</div> <!--! end widget-wrap -->

I added a class group to widget-wrap, you already know what this class does. Next, I created 3 div links that contain an unordered list, blog which contains a heading, image, title, date, and read more link. Lastly, the location which contains an image, and the address.

Now let’s style all the elements. Here’s the CSS.

/* WIDGET */
#widget-wrap{
	padding: 50px 0;
	background: #333333 url(images/widget-bg.jpg);
}
#widget{
	width: 960px;
	margin: 0 auto;
}
h4.footer-header{
	background: transparent url(images/footer-header.png) no-repeat;
	line-height: 58px;
	text-indent: 30px;
}
#links{
	width: 225px;
	float: left;
	margin-right: 75px;
}
#links ul{
	list-style-image: url(images/links.png);
	margin-left: 15px;
}
#links ul li a{
	color: #cccccc;
	font-size: 13px;
	padding: 8px 0;
	display: block;
}
#links ul li a:hover{
	color: #fff;
}
#blog{
	position: relative;
	width: 290px;
	float: left;
	margin-right: 75px;
}
#blog img{
	position: absolute;
	top: 50px;
	left: -18px;
}
#blog p.title{
	color: #fff;
	margin-left: 110px;
	margin-bottom: 15px;
}
#blog p.date{
	margin-left: 110px;
	color: #cccccc;
	font-style: italic;
	font-size: 11px;
	margin-bottom: 15px;
}

#blog a.readmore{
	margin-left: 110px;
}
#location{
	position: relative;
	width: 290px;
	float: right;
}
#location img{
	position: absolute;
	top: 45px;
	left: 22px;
}
#location p.address{
	margin-top: 115px;
	border-right: 1px solid #484848;
	padding-right: 20px;
	text-align: right;
	color: #cccccc;
}
/* END WIDGET */

 

I styled widget-wrap div with a padding of 50px top and bottom and added a gray dotted pattern background. For the widget div I applied 960px width and position it centered. For the links div I gave it a width of 225px, floated it to left, and give it a right margin 75px, for the ul list. I added a background image, also I styled the a with a lighter gray and hover of white (I didn’t follow the hover effect in the PSD design).

For the blog div I gave it a width of 290px, floated it to left, apply a 75px margin and position it relatively. For the heading I added a background, indented the text, and added 58px line height to make the text centered vertically. For the blog img since we just positioned blog div to relative, we can now position this absolutely to position the image the same to PSD design which is left 18px. For the .title.date and .readmore they have the same margins from left. For the location the same also in the blog where it is positioned relatively and position the inside image absolutely, and for the address, I added margin and paddings and give it a 1px border to the right.

Now our layout should look like this.

converting psd to html tutorial

Share on facebook
Facebook
Share on twitter
Twitter
Share on whatsapp
WhatsApp

Order a Instant Service