<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>HTML Archives - Michael Soriano</title>
	<atom:link href="https://michaelsoriano.com/tag/html/feed/" rel="self" type="application/rss+xml" />
	<link>https://michaelsoriano.com/tag/html/</link>
	<description>I turn code into captivating user experiences for the web</description>
	<lastBuildDate>Mon, 14 Dec 2009 01:30:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.4</generator>
	<item>
		<title>Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</title>
		<link>https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/</link>
					<comments>https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/#comments</comments>
		
		<dc:creator><![CDATA[Michael Soriano]]></dc:creator>
		<pubDate>Mon, 14 Dec 2009 01:30:22 +0000</pubDate>
				<category><![CDATA[Design & UX]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Photoshop]]></category>
		<guid isPermaLink="false">http://fearlessflyer.com/?p=1035</guid>

					<description><![CDATA[<p>Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in [&#8230;]</p>
<p>The post <a href="https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Now we have come to part 2 of this series on how to create a single page portfolio from scratch. This part focuses on the HTML and CSS mark up to convert our .psd file to a living web page. The tools we need for this is of course &#8211; Photoshop, an HTML editor (in my case I’m using Dreamweaver) and multiple browsers for page testing. We’re also going to toggle between these tools a lot so be prepared to switch programs by using alt + tab often.<br />
<a href="http://demo.michaelsoriano.com/single-page-portfolio/">View the Demo:</a><br />
This tutorial is part 2 of three parts: 1) <strong><a href="https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">the Photoshop Mock up</a></strong>, 2) <strong><a href="https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Coding the HTML / CSS</a></strong> and finally 3) <strong><a href="https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-3-jquery-and-php/">Adding PHP / jQuery</a>.</strong><br />
To preview what we are going to build &#8211; <strong><a href="http://demo.michaelsoriano.com/single-page-portfolio/">see the demo page</a></strong>. Just in case you missed the first tutorial, click <strong><a href="https://michaelsoriano.com/2009/11/create-a-single-page-portfolio-from-scratch-part-1-photoshop-mockup/">here</a></strong>. So are you ready to get started? Let’s begin:<br />
<img fetchpriority="high" decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/part2.jpg" alt="part2" title="This is Part 2 of a 3 part series" width="576" height="189" class="alignnone size-full wp-image-1122" style="border:0;" /></p>
<h3>The Wrap, Header and Feature Divs</h3>
<p>First of all, you will notice that our layout doesn’t really have anything in the header. This is because I’m sure you will use your own logo for your design &#8211; so I left that out. Second, is there really is no need for a navigation bar because we’re only building a single page. Although we may include some anchors in this area so we can quickly jump from one section of the page to another. Also important to recognize that most modern websites now have a large “feature” section which packs the main message of the website. This effect is proven to be pretty effective &#8211; that’s why we’re applying the same concept to our portfolio site.<br />
In Dreamweaver, create a new HTML page, name it “<strong>index.html</strong>” and save it.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp1.jpg" alt="sp1" title="New HTML document in Dreamweaver" width="576" height="478" class="alignnone size-full wp-image-1037" /><br />
Create a CSS document &#8211; name it “<strong>styles.css</strong>” and save it in the same location as “index.html”. Link to the stylesheet from index.html by using a link tag:<br />
<script src="https://gist.github.com/michaelsoriano/c51db1a37bdd76d539ad.js"></script><br />
Now, we create the main DIV &#8211; we’ll call this the “<strong>wrap</strong>”. In this DIV we’ll house almost all of our elements (all but one: the footer &#8211; which I’ll explain later). In index.html, enter the code:<br />
<script src="https://gist.github.com/michaelsoriano/8b91df01b5dce9ed7738.js"></script><br />
Next, we grab the body style of our page. Go to Photoshop and open our mockup. Flatten the image (“<strong>Layer</strong>” > “<strong>Flatten Image</strong>”) and grab a piece of background:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp2.jpg" alt="sp2" title="Grab a piece for the background" width="576" height="334" class="alignnone size-full wp-image-1038" /><br />
Still in Photoshop, press Ctrl + C to copy the selected area, create a new document &#8211; and paste (this will be our HTML body background that will span horizontally). Save this file as “<strong>body-bg.gif</strong>” inside a folder called “<strong>images</strong>” in our root directory.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp3.jpg" alt="sp3" title="Save as body-bg.gif" width="576" height="478" class="alignnone size-full wp-image-1039" /><br />
Next is we apply some fixin’s to our CSS:<br />
<script src="https://gist.github.com/michaelsoriano/27d622dcf1ab09f70202.js"></script><br />
The above code tells everything to reset to 0 padding and 0 margin. It also applies the body background to the image we just created, repeat it horizontally and apply the color #f3f2ed everywhere else. View your file in the browser, you should have something like below:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp4.jpg" alt="sp4" title="This is how our HTML looks so far" width="576" height="454" class="alignnone size-full wp-image-1040" /><br />
Now remember we created the main div? That is just sitting in somewhere in the page. Let’s apply some standard measurements to it and align it so it settles perfectly in the middle of our browser.<br />
Note that in the beginning of this tutorial &#8211; I was going to use the <strong>960.gs</strong> framework, but feel as though I’m cheating because the tutorial calls for “<strong>from scratch</strong>”. So I decided, I’m not using the framework and code everything by hand, hence &#8211; “<strong>from scratch</strong>”.<br />
Add this code to your style.css:<br />
<script src="https://gist.github.com/michaelsoriano/7be228ed5b59ab050cbf.js"></script><br />
This centers our wrap in the middle of the page, as well as set the default 960 pixels width. The background color and the minimum height properties are added temporarily so we can tell from the browser what we’re working with. Refresh your page and you should have something like below:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp5.jpg" alt="sp5" title="Our Wrap DIV in gray background" width="576" height="349" class="alignnone size-full wp-image-1041" /><br />
Go back to index.html and add the <strong>header </strong>div inside the wrap div:<br />
<script src="https://gist.github.com/michaelsoriano/d57e7f8055e5f513ae18.js"></script><br />
Back to our style.css &#8211; add this piece of code:<br />
<script src="https://gist.github.com/michaelsoriano/c7183bdfef835d3e3f12.js"></script><br />
Refresh your browser &#8211; and you can see where our header sits nicely on top. The background color again is temporary.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp6.jpg" alt="sp6" title="See the Header?" width="576" height="349" class="alignnone size-full wp-image-1042" /><br />
Next is our feature div. Create a new div tag in your index.html with the id of “<strong>feature</strong>”, place in between the “feature” divs. Add two paragraph tags inside with your own text. In my case &#8211; I’m using the default Lorem latin filler text:<br />
<script src="https://gist.github.com/michaelsoriano/781ec5eb4acbedc5b943.js"></script><br />
Notice the first paragraph tag has an id of “<strong>slogan</strong>”. This is because this is the primary text that we are going to style with an image. We are treating it as regular text for SEO purposes.<br />
Go back to your mock up in Photoshop and press “<strong>Step Backward</strong>” (ctrl + z + alt) several times until you get the fully layered version once again. Make sure the guides are showing &#8211; select the feature section like below:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp7.jpg" alt="sp7" title="Grab our Feature Area in Photohsop" width="576" height="454" class="alignnone size-full wp-image-1043" /><br />
In your layers panel, make sure you hide all the layers that shouldn’t be shown. This includes all the background layers and text elements. The only layer that should remain is the large feature image and the borders and glow to the left. Select the feature area and hit crop (“image” > “crop”). Save this as “<strong>feature.png</strong>” inside our images folder. This will be our feature div background image:<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp8.jpg" alt="sp8" title="Save as feature.png" width="576" height="413" class="alignnone size-full wp-image-1044" /><br />
Now in our styles.css &#8211; add the following code:<br />
<script src="https://gist.github.com/michaelsoriano/d2f0f5d19d255c0b0ade.js"></script><br />
Go back to your mockup and click “<strong>Step Backward</strong>” (“Edit” > “Step Backward”) to uncrop. Unhide the slogan layer and select it according to the guides. Crop once again and save this as “<strong>slogan.png</strong>”.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp9.jpg" alt="sp9" title="Save as slogan.png" width="576" height="454" class="alignnone size-full wp-image-1045" /><br />
Now add this code to your styles.css:<br />
<script src="https://gist.github.com/michaelsoriano/38d858c4f48b3ba20d15.js"></script><br />
The above code styles the two paragraph tags inside the feature div. The first one with a background image, and the next one as plain text. Now when search engines crawl our page &#8211; it still thinks both are plain text &#8211; which is a good thing.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp10.jpg" alt="sp10" title="Voila! Our HTML is coming along!" width="576" height="387" class="alignnone size-full wp-image-1046" /><br />
I’ve also taken out the color property in our wrap div to see how our feature looks like. Another thing to remember is that since our feature sits in its own div &#8211; it will be easy to add a slideshow or something to that effect as replacement.<br />
Now that our wrap, header and feature is in place, we’re ready to move to the next sections: <strong>Testimonials and Previous Work:</strong></p>
<h3>Testimonials and Previous Work Sections</h3>
<p>If the feature section is our hard hitter &#8211; a testimonials area is our “<strong>counter punch</strong>”. Testimonials are a sure fire way of telling our viewers: “<em>we’re good &#8211; read what others are saying about me!</em>”. Also another proven way of increasing business, it is also the reason why we’re putting testimonials right below our feature section. Ready to continue coding? Let’s keep going.<br />
In our index.html, add the code for our testimonials. Place this directly below our feature div:<br />
<script src="https://gist.github.com/michaelsoriano/d73dacd1441815167d20.js"></script><br />
Of course, you substitute real testimonials and authors in its place. Notice the “first” and “last” additional classes to the columns &#8211; we need this to fix our margins in our css. Next, go back to Photoshop and go backwards again so you get back to the original uncropped file. Select the Testimonials title all the way to the rightmost guide. Crop and save as “<strong>testimonials-title.jpg</strong>” inside our images folder.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp11.jpg" alt="sp11" title="Our Headings Background - Testimonials" width="576" height="454" class="alignnone size-full wp-image-1047" /><br />
Inside styles.css, append the below code:<br />
<script src="https://gist.github.com/michaelsoriano/f8dbd7190996ff964df1.js"></script><br />
This code adds the background image that we just created to the main testimonials div. It also adds proper styling to the columns inside the div, and fixes to the margins so it remains inside our imaginary grid.<br />
<strong>The optional “more” tab</strong><br />
The more tab is only necessary if you have more than 3 columns of testimonials that you would like to show. The point is just show 3 columns at first, and by clicking the “<strong>more</strong>” tab &#8211; more testimonial columns will slide below &#8211; most likely to be achieved by jQuery (I haven’t gotten there yet &#8211; remember &#8211; I’m writing this tutorial as I go!).<br />
To add a more tab &#8211; add this code to your HMTL, right underneath the last column div:<br />
<script src="https://gist.github.com/michaelsoriano/436475407cf4c545d6e2.js"></script><br />
Note that we used a class for our div instead of an id. This is because this div can actually be reused in another section of our page.<br />
Go back to your Photoshop file &#8211; click “<strong>Step Backwards</strong>” to the uncropped version &#8211; select the section that shows the “<strong>more testimonials</strong>” border and button according to your guides. Remember to hide the text layer over the button.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp12.jpg" alt="sp12" title="Our More Tab in the bottom of the section" width="576" height="454" class="alignnone size-full wp-image-1048" /><br />
Crop and save this as “<strong>more-bg.jpg</strong>” inside the images folder. Add the code below to your .css file:<br />
<script src="https://gist.github.com/michaelsoriano/f2971796332aa9270e28.js"></script><br />
For the “<strong>Previous Work</strong>” section &#8211; it’s pretty much the same process as testimonials. The difference is &#8211; we are actually using an unordered list instead of div columns. Add the following code inside your HTML:<br />
<script src="https://gist.github.com/michaelsoriano/4ccbf44d961fae561234.js"></script><br />
The thumbnail sizes are going to be 200 pixels width by152 pixels height. My sample code contains dummy thumbnails along with temporary images for the bigger image. We are incorporating a light box effect in the final product so users do not actually leave the page when viewing your gallery. Notice the addition of the “<strong>more</strong>” tab &#8211; which is again, purely optional.<br />
For the “<strong>Previous Work</strong>” title &#8211; you do the same exact process in Photoshop as you did previously in the Testimonials title. Save this image in the images folder &#8211; name it: “<strong>previous-work-title.jpg</strong>”.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp13.jpg" alt="sp13" title="Our other Heading Image - Previous Work" width="576" height="454" class="alignnone size-full wp-image-1049" /><br />
Now we add some styling to the list items, thumbnails and the entire div section:<br />
<script src="https://gist.github.com/michaelsoriano/1c5750671b9022a8d476.js"></script><br />
I also created a couple of thumbnail image backgrounds for the active and hover states. Again this is purely optional and I won’t go over in this tutorial.<br />
Now refresh your page in your browser. You should have something like the image below. It is also good practice to start viewing your page in different browsers. This way &#8211; you can start fixing bugs this early in the development process. Next stop is the <strong>footer</strong>.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp14.jpg" alt="sp14" title="The fold and below the fold become unfolded" width="576" height="566" class="alignnone size-full wp-image-1050" /></p>
<h3>The Footer</h3>
<p>Let’s go back to our Photoshop file &#8211; you may have to go back in history a couple of times to get you to the uncropped, fully layered version. Another thing to remember is <strong>NOT</strong> to save your original mock up file. This file is to stay in its original form &#8211; we are just cropping, hiding layers as we go to get the parts we want. But in the whole, this mockup .psd file remains in its original state. Select the footer area &#8211; starting from the guide a few pixels above the dark brown area.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp15.jpg" alt="sp15" title="Our Footer in Photoshop" width="576" height="566" class="alignnone size-full wp-image-1051" /><br />
Once selected &#8211; crop the selection &#8211; but don’t save as of yet; we’re going to save a couple of images from this selection &#8211; one is the footer wrap, the other is the actual footer background.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp16.jpg" alt="sp16" title="Grab a piece for our background" width="576" height="204" class="alignnone size-full wp-image-1052" /><br />
Once cropped, select the first 20 pixels from the left and crop once again. Save this file as “<strong>footer-wrap.gif</strong>” inside our images folder. Now go back to the Photoshop file and step backwards a couple of times to bring us to entire cropped footer image. Hide the layer group named “<strong>form</strong>”, as well as all the text layers in the footer area.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp17.jpg" alt="sp17" title="Hide Layers and save as the main footer background" width="576" height="388" class="alignnone size-full wp-image-1053" /><br />
Save this file as “<strong>footer.jpg</strong>” in the images folder. Unhide the text layer that says “Hire Me for Professional Work”, and hide all the background layers so you get full transparency. Select the text area using the rectangular marquee tool and crop. Save this file as “<strong>slogan2.png</strong>” in our images folder.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp18.jpg" alt="sp18" title="Our slogan as .png image" width="576" height="194" class="alignnone size-full wp-image-1054" /><br />
Now hit “<strong>Step Backward</strong>” (ctrl + alt + z) a couple of times to get to the uncropped footer image and unhide the “<strong>form</strong>” group of layers. Make sure you hide all the layers inside the form &#8211; all we need is the rounded container that embodies the form. Select this area, crop and save this file as “<strong>form-bg.png</strong>” in our images folder.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp19.jpg" alt="sp19" title="Our Form background - save as form-bg.png" width="576" height="269" class="alignnone size-full wp-image-1055" /><br />
Finally, unhide the button text, shape and glow. Create guides that surround the button image and select accordingly. Crop and save as “<strong>submit.png</strong>” in our images folder.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp20.jpg" alt="sp20" title="Thats one kick ass submit button!" width="576" height="192" class="alignnone size-full wp-image-1056" /><br />
Now go back to our index.html, add the following code right underneath the entire wrap div.<br />
<script src="https://gist.github.com/michaelsoriano/5e198aa821be90c2e740.js"></script><br />
The above code sets up all the content in the footer. This includes the two paragraphs on the left side and the contact form. Note that the form is still static. We will be converting this into a working form once we convert this to PHP.<br />
Next up, is to style the contact form. Add the following code to your styles.css:<br />
<script src="https://gist.github.com/michaelsoriano/8eb0fae531f3a7e89cb7.js"></script><br />
The above code sets up our footer wrap to span the entire width of the page with its own background image repeating horizontally. Now you understand why we excluded this from the main wrap div? The rest of the code applies the styling to the footer and contact form &#8211; tied to the images we created in the previous steps.<br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp21.jpg" alt="sp21" title="With all the form elements in place - it looks like a form!" width="576" height="252" class="alignnone size-full wp-image-1057" /><br />
Finally, we add the final touches to the two paragraph tags on the left side. Add this code to your styles.css:<br />
<script src="https://gist.github.com/michaelsoriano/41883b9a7df5df65a8ea.js"></script><br />
<img decoding="async" src="https://michaelsoriano.com/wp-content/uploads/2009/12/sp22.jpg" alt="sp22" title="Our SEO aware slogan and mini slogan" width="576" height="252" class="alignnone size-full wp-image-1036" /><br />
That concludes are HTML and CSS tutorial on our single page portfolio. Remember, we still have the scripting side to do &#8211; which is handled by PHP and jQuery, which we&#8217;ll cover in the next series. <strong><a href="http://demo.michaelsoriano.com/single-page-portfolio/">Click Here to see the DEMO Version</a></strong> of what we just created. The <strong><a href="https://app.box.com/s/hgg0h3h5d3deq168d5jp">source code is also available to download</a></strong> &#8211; which includes all the files covered in this tutorial.</p>
<p>The post <a href="https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/">Create a Single Page Portfolio from Scratch &#8211; Part 2: HTML and CSS</a> appeared first on <a href="https://michaelsoriano.com">Michael Soriano</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://michaelsoriano.com/create-a-single-page-portfolio-from-scratch-part-2-html-and-css/feed/</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
	</channel>
</rss>
