Hi, guys. The topic of today\u2019s article is \u201cHow to export an app PSD to Angular\u201d. To be honest, creating a template of a website in Photoshop is a bit old-fashioned option, but such practice remains in the development world.<\/p>\n
I am going to show you how to convert the app template that was created in Photoshop to the HTML format using such a framework as Angular<\/a>.<\/p>\n The format is intended for storing bitmap images in an Adobe Photoshop project file. Being stored uncompressed, it contains color spaces, masked layers, bi-color settings, layer structures, and other data for fine-tuning the bitmap.<\/p>\n First of all, the abbreviation HTML stands for HyperText Markup Language. HTML is a web format file. You can edit the HTML source code in a text editor. HTML files are developed for future use in users’ web browsers and allow you to format sites with text, images and other necessary materials. Files in this format use tags to create web pages. The interpretation of the HTML code is done by the web browser, and this code is usually not shown to the user.<\/p>\n Photoshop can transform a template into a gruesome fixed template that will look terrible. You do not want this because this is a nightmare. The best and the only way is to slice the layout, name the slices forensically, and then export them. Then code your html \/ css manually in Angular. This is what everyone is doing, so there is nothing wrong with that. Sure, your html \/ css has to be good to do a good job, but that’s why the developers get paid.<\/p>\n By the way, using a number of images in layouts and images with text is a very bad practice. There are several excuses for doing this now, with the possible exception of custom marketing materials.<\/p>\n First, we need to create a simple folder, preferably on the desktop. Create a folder, name it whatever you like. And we create another folder, and name it images<\/i><\/em>, I think that everything is clear here that all the pictures will be in this folder. After that, you need to create another ordinary text document and name it index<\/i><\/em>.<\/p>\n We have already taken the first step. Let’s move on to adding HTML code to Angular.<\/p>\n Open our index <\/i><\/em>text document through Angular and paste the following code into it:<\/p>\n <! DOCTYPE html><\/i><\/em><\/p>\n <html><\/i><\/em><\/p>\n <head><\/i><\/em><\/p>\n <script type = “text \/ javascript” src = “http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.4.2\/jquery.min.js”> <\/script><\/i><\/em>\u00a0<\/i><\/em><\/p>\n <meta charset = “utf-8” \/><\/i><\/em><\/p>\n <title> Layout <\/title><\/i><\/em><\/p>\n <\/head><\/i><\/em><\/p>\n <body><\/i><\/em><\/p>\n <! – Start Header -><\/i><\/em><\/p>\n <header class = “header”><\/i><\/em><\/p>\n <div id = “headerInner”><\/i><\/em><\/p>\n <\/div><\/i><\/em><\/p>\n <\/header> <! – End of header -><\/i><\/em><\/p>\n <! – start of wrapper -><\/i><\/em><\/p>\n <section id = “wrapper”><\/i><\/em><\/p>\n <div id = “middle”><\/i><\/em><\/p>\n <div id = “content”><\/i><\/em><\/p>\n <div id = “colLeft”><\/i><\/em><\/p>\n <\/div> <! – End of call -><\/i><\/em>\u00a0<\/i><\/em><\/p>\n <aside id = “colRight”><\/i><\/em><\/p>\n <\/aside> <! – End of color -><\/i><\/em><\/p>\n <\/div> <! – End content -><\/i><\/em><\/p>\n <\/div> <! – End middle -><\/i><\/em><\/p>\n <\/section> <! – End of wrapper -><\/i><\/em><\/p>\n <! – Start footer -><\/i><\/em><\/p>\n <footer id = “footer”><\/i><\/em><\/p>\n <div id = “footerInner”><\/i><\/em><\/p>\n <\/div> <! – End of the fuuterinner -><\/i><\/em><\/p>\n <\/footer> <! – End footer -><\/i><\/em>\u00a0<\/i><\/em><\/p>\n <\/body><\/i><\/em><\/p>\n <\/html><\/i><\/em><\/p>\n Now let’s take a closer look at the code. The future template will be divided into three parts. This is the site header, middle, and bottom of the site.<\/p>\n This code is responsible for the top of the site:<\/p>\n <! – Start Header -><\/i><\/em><\/p>\n <header class = “header”><\/i><\/em><\/p>\n <div id = “headerInner”><\/i><\/em><\/p>\n <\/div><\/i><\/em><\/p>\n <\/header> <! – End of header -><\/i><\/em><\/p>\n But, id = “headerInner”<\/i><\/em>\u00a0will include the top and main bottom menus, as well as social bookmarking buttons. Another id = “headerInner”<\/i><\/em>\u00a0is 1200 px wide and is placed in the middle of the browser window. Next, we will set the appropriate CSS styles for it.<\/p>\n This code is responsible for the middle section:<\/p>\n <! – start of wrapper -><\/i><\/em><\/p>\n <section id = “wrapper”><\/i><\/em><\/p>\n <div id = “middle”><\/i><\/em><\/p>\n <div id = “content”><\/i><\/em><\/p>\n <div id = “colLeft”><\/i><\/em><\/p>\n <\/div> <! – End of call -><\/i><\/em><\/p>\n <aside id = “colRight”><\/i><\/em><\/p>\n <\/aside> <! – End of color -><\/i><\/em><\/p>\n <\/div> <! – End content -><\/i><\/em><\/p>\n <\/div> <! – End middle -><\/i><\/em><\/p>\n <\/section> <! – End of wrapper -><\/i><\/em><\/p>\n id = “wrapper”<\/i><\/em>\u00a0is a large middle block that will include the left and right sides of the site. In other words, on the left side we will display the latest posts, and on the right sidebar widgets.<\/p>\n id = “content” <\/i><\/em>– is responsible for aligning the left and right sides to the top.<\/p>\n id = “colLeft” <\/i><\/em>– the left side of the site (Posts)<\/p>\n id = “colRight”<\/i><\/em>\u00a0– right side (sidebar)<\/p>\n Basically, it is almost the same as the top blue bar of the layout.<\/p>\n <! – Start footer -><\/i><\/em><\/p>\n <footer id = “footer”><\/i><\/em><\/p>\n <div id = “footerInner”><\/i><\/em><\/p>\n <\/div> <! – End of the footerinner -><\/i><\/em><\/p>\n <\/footer> <! – End footer -><\/i><\/em><\/p>\n First you need to select an HTML editor.<\/p>\n Once you’ve pasted the code into our index <\/i><\/em>text document, you need to save it. Click on “file” and “save as”, then select the encoding “UTF – 8” and save.<\/p>\n When the file is saved, rename its resolution from .txt to .html. Now we open our file using the browser. We will have a simple white field, right-click on it, select “Source Code” and we will be taken to the editor. To see the changes after editing the code, you need to click on “Apply changes”.<\/p>\n I recommend writing styles right there. Then they can simply be transferred to a separate file and attached to the html code. Before the\u00a0<\/head><\/i><\/em>\u00a0tag, put the <style> … <\/style> <\/i><\/em>tags, and between them, accordingly, the CSS code will be located.<\/p>\n Add this CSS code:<\/p>\n * {<\/i><\/em><\/p>\n \u00a0margin: 0;<\/i><\/em><\/p>\n \u00a0padding: 0;<\/i><\/em><\/p>\n }<\/i><\/em><\/p>\n body {<\/i><\/em><\/p>\n \u00a0width: 100%;<\/i><\/em><\/p>\n \u00a0height: 100%;<\/i><\/em><\/p>\n \u00a0color: # 333;<\/i><\/em><\/p>\n \u00a0background: #fff;<\/i><\/em><\/p>\n \u00a0font-family: “Segoe UI”, “HelveticaNeue-Light”, “Helvetica Neue Light”, “Helvetica Neue”, Helvetica, Arial, sans-serif;<\/i><\/em><\/p>\n \u00a0font-size: 0.94em;<\/i><\/em><\/p>\n \u00a0line-height: 135%;<\/i><\/em><\/p>\n }<\/i><\/em>\u00a0<\/i><\/em><\/p>\n aside, nav, footer, header, section {display: block; }<\/i><\/em><\/p>\n ul {<\/i><\/em><\/p>\n \u00a0list-style: none;<\/i><\/em><\/p>\n }<\/i><\/em>\u00a0<\/i><\/em><\/p>\n a {<\/i><\/em><\/p>\n \u00a0text-decoration: none;<\/i><\/em><\/p>\n }<\/i><\/em><\/p>\n a: hover {<\/i><\/em><\/p>\n \u00a0text-decoration: none;<\/i><\/em><\/p>\n }<\/i><\/em>\u00a0<\/i><\/em><\/p>\n Here we have set some styles for the body tag. Width and height 100%. The color for the text is #333. Also we have set some fonts, and its size, as well as the distance between lines.<\/p>\n Now we insert this code of CSS styles that are responsible for the positioning of the main three blocks on the browser page.<\/p>\n #wrapper {<\/i><\/em><\/p>\n \u00a0margin-top: 40px;<\/i><\/em><\/p>\n \u00a0width: 1200px;<\/i><\/em><\/p>\n \u00a0margin: 0 auto;<\/i><\/em><\/p>\n \u00a0height: auto! important;<\/i><\/em><\/p>\n \u00a0}<\/i><\/em>\u00a0<\/i><\/em><\/p>\n .header {<\/i><\/em><\/p>\n \u00a0width: 100%;<\/i><\/em><\/p>\n \u00a0background: # 0dbfe5;<\/i><\/em><\/p>\n \u00a0height: 57px;<\/i><\/em><\/p>\n \u00a0z-index: 4;<\/i><\/em><\/p>\n \u00a0}<\/i><\/em><\/p>\n #headerInner {<\/i><\/em><\/p>\n \u00a0position: relative;<\/i><\/em><\/p>\n \u00a0border: 0px solid # 333;<\/i><\/em><\/p>\nWhat is PSD?<\/h1>\n
What is HTML?<\/h1>\n
Why is it not good to create a template of a website in Photoshop nowadays?<\/h2>\n
How to export an app PSD to Angular<\/a>?<\/h2>\n
\n
\nPreparation<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n
\n
\nAdding HTML layout<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n
\n
\nSite header<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n
\n
\nMiddle of the site<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n
\n
\nBottom of the site<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n
HTML and CSS layout<\/h2>\n
CSS<\/h2>\n
\n
\nMain blocks (top, middle and bottom)<\/b><\/strong><\/h3>\n<\/li>\n<\/ul>\n