{"id":1416,"date":"2008-03-20T00:00:06","date_gmt":"2008-03-20T05:00:06","guid":{"rendered":"http:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web"},"modified":"2008-03-20T03:00:38","modified_gmt":"2008-03-20T08:00:38","slug":"horizontal-menu-%e2%80%93-from-photoshop-to-the-web","status":"publish","type":"post","link":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web","title":{"rendered":"Horizontal Menu \u2013 From Photoshop to the Web"},"content":{"rendered":"

This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu. <\/p>\n

The menu I have decided to create a menu similar to the one I used on Computer Systems Solutions<\/a> website.<\/p>\n

Photoshop and CSS Horizontal Menu Tutorial<\/p>\n

As you can see we have a simple menu. All we really need to create are two fill images for the menu and the mouse over. So we will go into Photoshop and create a new image. I am going to make the canvas 700x100px with a white back ground.<\/p>\n

The first we need to do is create a new layer. Then draw a 20px tall square (you can make it as large as you want, but you will have to adjust the css later on) using the marquee tool. The length doesn\u2019t really matter and you will see why later. Fill the square with any color, since we will apply layer styles to it.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Now we can apply our layer styles. Right click on the layer and select blending options. Apply the following options.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Photoshop and CSS Horizontal Menu Tutorial<\/p>\n

Stroke:
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Apple the style and you have your basic menu.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Normally for a layout I would use the Photoshop slice tool for this next step, but since we are only working with one image, zoom in and make a selection that is the exact height of the menu and 1px wide like below.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Next, on the menu in Photoshop go to Image > Crop. You should then have a 1px wide image.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Now go to File > Save > Save Image for web and save it as menu.jpg
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Now we have a background save. Next we will change the gradient to create the blue highlight when the button is hovered over. Return to the image and select the Blending Options again. Change the gradient to this color
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Now go to save for web again and save this one as menu-over.jpg<\/p>\n

Now we have the two images we need to make our menu. The next step is coding the menu itself, and then applying some CSS to make it look pretty.
\nOpen you favorite editor and and create a basic unordered list in HTML and attach a style sheet in the head section. We will use the style sheet later.<\/p>\n

\r\n<html>\r\n<head>\r\n<title>Test Menu from Teamtutorials.com<\/title>\r\n<style type="text\/css" media="screen">\r\n\t@import url( style.css );\r\n<\/style>\r\n<\/head>\r\n\r\n<body>\r\n\r\n<ul class="solidblockmenu">\r\n       <li><a href="#">TeamTutorials<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 1<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 2<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 3<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 4<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 5<\/a><\/li>\r\n\r\n<\/ul>\r\n\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n

As you can see the ul tag has a class of solidblockmenu. You will assign style to this element later. Save the file as test.htm and open it in your browser. It should look something like this.<\/p>\n

Photoshop and CSS Horizontal Menu Tutorial<\/p>\n

So we have a pretty basic menu. Now we can spice it up with some CSS. Open a new document in you favorite editor (I like notepad). <\/p>\n

I will try to explain each section of the CSS the best I can using comments in the code, the full CSS source is available toward the bottom of this post.<\/p>\n

\r\n\r\n.solidblockmenu li{\r\n\tdisplay: inline; <!-- display items as blocks-->\r\n}\r\n\r\n.solidblockmenu li a{ <!--styling the links-->\r\n\tcolor: black; <!--sets font color to black-->\r\n\tpadding: 2px 11px; <!-- we apply padding to our links to make the buttons wider than the text-->\r\n\ttext-decoration: none; <!-- no style(underline, etc) for the links. -->\r\n\tborder-right: 1px solid #ababab; <!-- this sets the right border of the the link. It creates the divider between buttons-->\r\n}\r\n\r\n.solidblockmenu li a:visited{\r\n\tcolor: black; <!--Jus changes the visite link to be black instead of the default color-->\r\n}\r\n\r\n.solidblockmenu li a:hover, .solidblockmenu li .current{ \r\n\tcolor: black; <!-- font color you could  also change this if you want-->\r\n\tbackground: transparent url(menu-over.jpg) center center repeat-x;<!--this sets the link to have our menu-over.jpg ad the background when it is hovered over-->\r\n}\t} <\/pre>\n

Here is the full CSS code without comments.<\/p>\n

\r\n.solidblockmenu{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\tfont: bold 13px Arial;\r\n\twidth: 700px;\r\n\theight: 21px;\r\n\tbackground: url(menu.jpg) center center repeat-x;\r\n}\r\n\r\n.solidblockmenu li{\r\n\tdisplay: inline;\r\n}\r\n\r\n.solidblockmenu li a{\r\n\tcolor: black;\r\n\tpadding: 2px 11px;\r\n\ttext-decoration: none;\r\n\tborder-right: 1px solid #ababab;\r\n}\r\n\r\n.solidblockmenu li a:visited{\r\n\tcolor: black;\r\n}\r\n\r\n.solidblockmenu li a:hover, .solidblockmenu li .current{\r\n\tcolor: black;\r\n\tbackground: transparent url(menu-over.jpg) center center repeat-x;\r\n}\r\n<\/pre>\n

Save the source code. Open the HTM file in your browser and you should have a functioning menu.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n

Now if you noticed in the last line of the CSS I setup a class called current. You can use that to highlight the button on the current page by default. So for example if this was the Sample3 page you would change your menu code to look like this:<\/p>\n

\r\n<html>\r\n<head>\r\n<title>Test Menu from Teamtutorials.com<\/title>\r\n<style type="text\/css" media="screen">\r\n\t@import url( style.css );\r\n<\/style>\r\n<\/head>\r\n\r\n<body>\r\n\r\n<ul class="solidblockmenu">\r\n       <li><a href="#">TeamTutorials<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 1<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 2<\/a><\/li>\r\n\r\n       <li><a href="#" class=\u201dcurrent\u201d>Sample 3<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 4<\/a><\/li>\r\n\r\n       <li><a href="#">Sample 5<\/a><\/li>\r\n\r\n<\/ul>\r\n\r\n<\/body>\r\n<\/html>\r\n<\/pre>\n

Then Sample 3 would be blue, but the other options would still highlight when you hover over them.
\nPhotoshop and CSS Horizontal Menu Tutorial<\/p>\n","protected":false},"excerpt":{"rendered":"

This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[44,30,4,17,10],"tags":[],"yoast_head":"\nHorizontal Menu \u2013 From Photoshop to the Web<\/title>\n<meta name=\"description\" content=\"This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-\u2013-from-photoshop-to-the-web\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Johnathan Ward\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/teamtutorials.com\/#website\",\"url\":\"https:\/\/teamtutorials.com\/\",\"name\":\"Team Tutorials\",\"description\":\"Learn something new today\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/teamtutorials.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/03\/horisontal-photoshop-css-html-menu-01.jpg\",\"contentUrl\":\"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/03\/horisontal-photoshop-css-html-menu-01.jpg\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#webpage\",\"url\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web\",\"name\":\"Horizontal Menu \\u2013 From Photoshop to the Web\",\"isPartOf\":{\"@id\":\"https:\/\/teamtutorials.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#primaryimage\"},\"datePublished\":\"2008-03-20T05:00:06+00:00\",\"dateModified\":\"2008-03-20T08:00:38+00:00\",\"author\":{\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9\"},\"description\":\"This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu.\",\"breadcrumb\":{\"@id\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/teamtutorials.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Horizontal Menu \\u2013 From Photoshop to the Web\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9\",\"name\":\"Johnathan Ward\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/teamtutorials.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r\",\"caption\":\"Johnathan Ward\"},\"description\":\"Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.\",\"sameAs\":[\"http:\/\/johnathanward.com\",\"https:\/\/twitter.com\/spyderman4g63\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Horizontal Menu \u2013 From Photoshop to the Web","description":"This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-\u2013-from-photoshop-to-the-web","twitter_misc":{"Written by":"Johnathan Ward","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/teamtutorials.com\/#website","url":"https:\/\/teamtutorials.com\/","name":"Team Tutorials","description":"Learn something new today","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/teamtutorials.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#primaryimage","inLanguage":"en-US","url":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/03\/horisontal-photoshop-css-html-menu-01.jpg","contentUrl":"http:\/\/teamtutorials.com\/wp-content\/uploads\/2008\/03\/horisontal-photoshop-css-html-menu-01.jpg"},{"@type":"WebPage","@id":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#webpage","url":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web","name":"Horizontal Menu \u2013 From Photoshop to the Web","isPartOf":{"@id":"https:\/\/teamtutorials.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#primaryimage"},"datePublished":"2008-03-20T05:00:06+00:00","dateModified":"2008-03-20T08:00:38+00:00","author":{"@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9"},"description":"This tutorial is a little different form our standard Photoshop tutorials. Normally I would show you how to make a web layout or menu in Photoshop, but I never really went into detail on how to make the layouts work on the web. In this tutorial I will show you how to make a simple menu using Photoshop, slice the images, and how to write the code for a functional menu.","breadcrumb":{"@id":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/teamtutorials.com\/photoshop-tutorials\/horizontal-menu-%e2%80%93-from-photoshop-to-the-web#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/teamtutorials.com\/"},{"@type":"ListItem","position":2,"name":"Horizontal Menu \u2013 From Photoshop to the Web"}]},{"@type":"Person","@id":"https:\/\/teamtutorials.com\/#\/schema\/person\/3abea1fc71644afe035403357450b9d9","name":"Johnathan Ward","image":{"@type":"ImageObject","@id":"https:\/\/teamtutorials.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/93d667fe5dc6df5c722e0df5eac14d40?s=96&d=mm&r=r","caption":"Johnathan Ward"},"description":"Johnathan Ward is an experienced developer and consultant that writes tutorials to help other developers. In his day job, he is an IBM Watson Consultant with several years of experience deploying and customizing Watson Explorer solutions.","sameAs":["http:\/\/johnathanward.com","https:\/\/twitter.com\/spyderman4g63"]}]}},"_links":{"self":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1416"}],"collection":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/comments?post=1416"}],"version-history":[{"count":0,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/posts\/1416\/revisions"}],"wp:attachment":[{"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/media?parent=1416"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/categories?post=1416"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teamtutorials.com\/wp-json\/wp\/v2\/tags?post=1416"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}