{"id":406,"date":"2018-05-21T23:06:15","date_gmt":"2018-05-21T23:06:15","guid":{"rendered":"https:\/\/ucsbwebdev.fzilla.com\/?p=406"},"modified":"2018-05-21T23:10:41","modified_gmt":"2018-05-21T23:10:41","slug":"preparing-for-the-midterm-retake-building-website-from-scratch","status":"publish","type":"post","link":"https:\/\/ucsbwebdev.fzilla.com\/?p=406","title":{"rendered":"Preparing for the Midterm Retake &#8211; Building website from scratch"},"content":{"rendered":"<h2>Building a simple website from scratch<\/h2>\n<p>In this tutorial we&#8217;ll build the exact same website from the midterm. It contains the following elements:<\/p>\n<ol>\n<li>Header: With a logo and a menu\n<ol>\n<li>The menu should have black buttons with white text<\/li>\n<\/ol>\n<\/li>\n<li>A two column main element\n<ol>\n<li>The left column should have a title and a vertical navigation<\/li>\n<li>The right column should contain a title and a paragraph of text<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>The final product should look like this:<\/p>\n<p id=\"JTxKZjt\"><img loading=\"lazy\" decoding=\"async\" width=\"1872\" height=\"648\" class=\"alignnone size-full wp-image-444 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0351e945649.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0351e945649.png 1872w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0351e945649-300x104.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0351e945649-768x266.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0351e945649-1024x354.png 1024w\" sizes=\"auto, (max-width: 1872px) 100vw, 1872px\" \/><\/p>\n<h2>Creating a project inside WebStorm<\/h2>\n<p>You can either create a project from the welcome screen<\/p>\n<p id=\"PiOjLNb\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-407 size-medium\" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034612e0df9-300x108.png\" alt=\"\" width=\"300\" height=\"108\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034612e0df9-300x108.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034612e0df9.png 550w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>Or if you&#8217;re already inside a project go to\u00a0<strong>File -&gt; New -&gt; Project<\/strong><\/p>\n<p id=\"RzLaogP\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-408\" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03463f39125.png\" alt=\"\" width=\"600\" height=\"94\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03463f39125.png 978w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03463f39125-300x47.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03463f39125-768x121.png 768w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>Replace where it says &#8220;untitled&#8221; with your project name<\/p>\n<p id=\"LnitDfZ\"><img loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"180\" class=\"alignnone size-full wp-image-409 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346680e8b6.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346680e8b6.png 792w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346680e8b6-300x68.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346680e8b6-768x175.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/p>\n<p>like this<\/p>\n<p id=\"uhokHYv\"><img loading=\"lazy\" decoding=\"async\" width=\"1216\" height=\"200\" class=\"alignnone size-full wp-image-410 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034672639ed.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034672639ed.png 1216w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034672639ed-300x49.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034672639ed-768x126.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034672639ed-1024x168.png 1024w\" sizes=\"auto, (max-width: 1216px) 100vw, 1216px\" \/><\/p>\n<p><strong>No spaces<\/strong>! Just text characters.<\/p>\n<p>Then click the\u00a0<strong>create<\/strong> button.<\/p>\n<h2>Starting our project with the needed files<\/h2>\n<p>We&#8217;ll first need our <strong>index.html\u00a0<\/strong>as this is the file our server will always look for to show to the user first (even if you have 100 other pages).<\/p>\n<p>Right click on the little folder with the name you chose for the project, then select <strong>New -&gt; HTML File<\/strong><\/p>\n<p id=\"CpSnmAt\"><img loading=\"lazy\" decoding=\"async\" width=\"1116\" height=\"240\" class=\"alignnone size-full wp-image-411 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346d0293e6.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346d0293e6.png 1116w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346d0293e6-300x65.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346d0293e6-768x165.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0346d0293e6-1024x220.png 1024w\" sizes=\"auto, (max-width: 1116px) 100vw, 1116px\" \/><\/p>\n<p id=\"XySCLeR\"><img loading=\"lazy\" decoding=\"async\" width=\"784\" height=\"342\" class=\"alignnone size-full wp-image-412 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03471974254.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03471974254.png 784w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03471974254-300x131.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03471974254-768x335.png 768w\" sizes=\"auto, (max-width: 784px) 100vw, 784px\" \/><\/p>\n<p>You should now see an index.html in the left column of your editor<\/p>\n<p id=\"VuYQMzR\"><img loading=\"lazy\" decoding=\"async\" width=\"334\" height=\"82\" class=\"alignnone size-full wp-image-413 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03473669ddb.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03473669ddb.png 334w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03473669ddb-300x74.png 300w\" sizes=\"auto, (max-width: 334px) 100vw, 334px\" \/><\/p>\n<p>Now we repeat the process to create a stylesheet called <strong>style.css\u00a0<\/strong>(please always use lowercase characters, no spaces, and try to name the files for each website the same! For example, your stylesheet can be named main.css or style.css, but those are really the only names you should use!)<\/p>\n<p id=\"iczhMZt\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"282\" class=\"alignnone size-full wp-image-414 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03478e94164.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03478e94164.png 1024w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03478e94164-300x83.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03478e94164-768x212.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p id=\"BEAqyQL\"><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"306\" class=\"alignnone size-full wp-image-415 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03479b1273e.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03479b1273e.png 724w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03479b1273e-300x127.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p id=\"HVBpjvC\"><img loading=\"lazy\" decoding=\"async\" width=\"530\" height=\"132\" class=\"alignnone size-full wp-image-416 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0347bad52db.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0347bad52db.png 530w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0347bad52db-300x75.png 300w\" sizes=\"auto, (max-width: 530px) 100vw, 530px\" \/><\/p>\n<h2>Adding your stylesheet in the HTML<\/h2>\n<p>For us to use a stylesheet (as there can be 10 available stylesheets in a big project for each page) we need to link it from the html file using the\u00a0<strong>link\u00a0<\/strong>tag.<\/p>\n<p>The\u00a0<strong>link\u00a0<\/strong>tag should go immediately before the closing of the\u00a0<strong>head\u00a0<\/strong>tag.<\/p>\n<p id=\"PTRhYUL\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"182\" class=\"alignnone size-full wp-image-417 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03481600002.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03481600002.png 682w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03481600002-300x80.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/p>\n<p>It contains two attributes, rel (relationship, it&#8217;s a stylesheet) and href\u00a0(which is the path to the stylesheet file).<\/p>\n<p>If we created a folder called\u00a0<strong>css\u00a0<\/strong>then the href would be\u00a0<strong>href=&#8221;css\/style.css&#8221;<\/strong> meaning we&#8217;re referencing the folder and then the file inside it.<\/p>\n<p>As a sanity check, making sure our stylesheet is now linked we can simply make the body background black. When we preview our html page the background should be black.<\/p>\n<p id=\"tnKLlRp\"><img loading=\"lazy\" decoding=\"async\" width=\"490\" height=\"198\" class=\"alignnone size-full wp-image-418 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03488975e8a.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03488975e8a.png 490w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03488975e8a-300x121.png 300w\" sizes=\"auto, (max-width: 490px) 100vw, 490px\" \/><\/p>\n<p>And then from within our index.html file we click the browser icon from the top right:<\/p>\n<p id=\"jPHFMTb\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"96\" class=\"alignnone size-full wp-image-419 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348aabcdae.png\" alt=\"\" \/><\/p>\n<p id=\"Hfytzhy\"><img loading=\"lazy\" decoding=\"async\" width=\"1272\" height=\"408\" class=\"alignnone size-full wp-image-420 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348b96a72c.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348b96a72c.png 1272w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348b96a72c-300x96.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348b96a72c-768x246.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348b96a72c-1024x328.png 1024w\" sizes=\"auto, (max-width: 1272px) 100vw, 1272px\" \/><\/p>\n<p>Great, we&#8217;re all set here, let&#8217;s erase the sanity code from style.css.<\/p>\n<p>To make it easier to look at both our html and css at the same time, you can simply right click on the\u00a0<strong>style.css\u00a0<\/strong>tab in your editor and choose split vertically<\/p>\n<p id=\"MlDaLkh\"><img loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"402\" class=\"alignnone size-full wp-image-421 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348f3cc6a9.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348f3cc6a9.png 626w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0348f3cc6a9-300x193.png 300w\" sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/p>\n<p>Then close the tab on the left side that says\u00a0<strong>style.css\u00a0<\/strong>leaving it only on the right-hand side.<\/p>\n<p id=\"LFihmhC\"><img loading=\"lazy\" decoding=\"async\" width=\"1208\" height=\"184\" class=\"alignnone size-full wp-image-422 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034919086b6.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034919086b6.png 1208w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034919086b6-300x46.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034919086b6-768x117.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034919086b6-1024x156.png 1024w\" sizes=\"auto, (max-width: 1208px) 100vw, 1208px\" \/><\/p>\n<p id=\"ngPfNJT\"><img loading=\"lazy\" decoding=\"async\" width=\"1168\" height=\"434\" class=\"alignnone size-full wp-image-423 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0349234c64d.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0349234c64d.png 1168w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0349234c64d-300x111.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0349234c64d-768x285.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b0349234c64d-1024x380.png 1024w\" sizes=\"auto, (max-width: 1168px) 100vw, 1168px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>Adding the initial\u00a0HTML markup<\/h2>\n<p>The very first thing we should tackle is each section of our website. In this case, we&#8217;re creating a simple website with two sections, a header and a main (which has the two columns).<\/p>\n<p id=\"fgCPGZO\"><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"274\" class=\"alignnone size-full wp-image-424 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03498d1ce37.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03498d1ce37.png 412w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03498d1ce37-300x200.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b03498d1ce37-272x182.png 272w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/p>\n<p>Keeping in mind all our code goes inside the body element! We use a class to identify each section, allowing us to reference them later when we apply styling.<\/p>\n<h2>Filling in the sections<\/h2>\n<p>Now we can start filling in each section with markup based on our website design. In the header, we have a logo and a menu. The menu contains buttons (anchor links).<\/p>\n<p id=\"FabkwuO\"><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"450\" class=\"alignnone size-full wp-image-425 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a241613b.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a241613b.png 590w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a241613b-300x229.png 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/p>\n<p>And the main section contains two columns:<\/p>\n<p id=\"fVhLtXY\"><img loading=\"lazy\" decoding=\"async\" width=\"480\" height=\"268\" class=\"alignnone size-full wp-image-426 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a4902eed.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a4902eed.png 480w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a4902eed-300x168.png 300w\" sizes=\"auto, (max-width: 480px) 100vw, 480px\" \/><\/p>\n<p>Each column has a title<\/p>\n<p id=\"OntMuoK\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"316\" class=\"alignnone size-full wp-image-427 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a710a047.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a710a047.png 448w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034a710a047-300x212.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>In the left column we add a vertical menu, and in the right a simple paragraph.<\/p>\n<p id=\"xUKommT\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"522\" class=\"alignnone size-full wp-image-428 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034aa6f1c24.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034aa6f1c24.png 682w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034aa6f1c24-300x230.png 300w\" sizes=\"auto, (max-width: 682px) 100vw, 682px\" \/><\/p>\n<p>Here is the final code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;!DOCTYPE html&gt;\r\n&lt;html lang=\"en\"&gt;\r\n&lt;head&gt;\r\n    &lt;meta charset=\"UTF-8\"&gt;\r\n    &lt;title&gt;Title&lt;\/title&gt;\r\n    &lt;link rel=\"stylesheet\" href=\"style.css\"&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n    &lt;div class=\"header\"&gt;\r\n        &lt;h1 class=\"logo\"&gt;\r\n            Logo\r\n        &lt;\/h1&gt;\r\n\r\n        &lt;div class=\"menu\"&gt;\r\n            &lt;a href=\"https:\/\/google.com\"&gt;\r\n                Go To Google\r\n            &lt;\/a&gt;\r\n            &lt;a href=\"https:\/\/microsoft.com\"&gt;\r\n                Go To Microsoft\r\n            &lt;\/a&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n\r\n    &lt;div class=\"main\"&gt;\r\n        &lt;div class=\"left-col\"&gt;\r\n            &lt;h2&gt;Welcome&lt;\/h2&gt;\r\n            &lt;div class=\"left-menu\"&gt;\r\n                &lt;a href=\"https:\/\/google.com\"&gt;\r\n                    Go To Google\r\n                &lt;\/a&gt;\r\n                &lt;a href=\"https:\/\/microsoft.com\"&gt;\r\n                    Go To Microsoft\r\n                &lt;\/a&gt;\r\n            &lt;\/div&gt;\r\n        &lt;\/div&gt;\r\n        &lt;div class=\"right-col\"&gt;\r\n            &lt;h2&gt;Great stuff&lt;\/h2&gt;\r\n            &lt;p&gt;Right column text&lt;\/p&gt;\r\n        &lt;\/div&gt;\r\n    &lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;<\/pre>\n<h2>Adding our styling<\/h2>\n<p>To make our webpage look the same in every browser we can include the <strong>normalize.css\u00a0<\/strong>library. We add it the same way we add our style.css, with a\u00a0<strong>link\u00a0<\/strong>tag, but we can use a CDN link instead of storing it in our project folder.<\/p>\n<p id=\"EvNmVzO\"><img loading=\"lazy\" decoding=\"async\" width=\"1680\" height=\"388\" class=\"alignnone size-full wp-image-431 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034c27acc12.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034c27acc12.png 1680w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034c27acc12-300x69.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034c27acc12-768x177.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034c27acc12-1024x236.png 1024w\" sizes=\"auto, (max-width: 1680px) 100vw, 1680px\" \/><\/p>\n<p>Very important to notice that we add the link tag\u00a0<strong>before our style.css, this ensures our styles override those of the normalize.css!\u00a0<\/strong>This is the same logic as when we add a framework. Styles declared lowed in the document are more important.<\/p>\n<p>Now we can focus on getting the website to look correctly. I will again do this section by section. Starting with the header.<\/p>\n<p>The header contains two immediate children, <strong>.logo and .menu\u00a0<\/strong>which should appear next to each other as columns. To do this we&#8217;ll apply:<\/p>\n<ol>\n<li><strong>display: flex; <\/strong>\/\/ making its immediate children display as columns<\/li>\n<li><strong>justify-content: space-between;\u00a0<\/strong>\/\/ forcing the columns to spread out to each side of the page adding space between them<\/li>\n<li><strong>align-items: center; \/\/<\/strong> now we can center the items inside vertically, because our logo will be much higher than the menu items and we want it to look nice<\/li>\n<\/ol>\n<p>Which will look like this:<\/p>\n<p id=\"uyncJCC\"><img loading=\"lazy\" decoding=\"async\" width=\"634\" height=\"224\" class=\"alignnone size-full wp-image-430 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034ba262b70.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034ba262b70.png 634w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034ba262b70-300x106.png 300w\" sizes=\"auto, (max-width: 634px) 100vw, 634px\" \/><\/p>\n<h3>Converting Anchor Links into Buttons<\/h3>\n<p>To make our navigational links appear as buttons (larger clickable area, custom colors, etc) we have to select the actual anchor tag with our CSS. Otherwise the browser will always apply its own styling that we can&#8217;t override.<\/p>\n<p>Here is how we select the anchors inside the\u00a0<strong>.menu\u00a0<\/strong>div:<\/p>\n<p id=\"WWGZNRP\"><img loading=\"lazy\" decoding=\"async\" width=\"232\" height=\"150\" class=\"alignnone size-full wp-image-432 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034cc44fd7b.png\" alt=\"\" \/><\/p>\n<p>By selecting\u00a0<strong>.menu\u00a0<\/strong>div first, then adding a space, and then entering the name of the anchor tag\u00a0<strong>a,\u00a0<\/strong>we are telling the browser to select\u00a0<strong>all anchor elements inside the div with a class menu.<\/strong><\/p>\n<p>Allowing us to apply the following important styles:<\/p>\n<ol>\n<li><strong>display: inline-block;\u00a0<\/strong>\/\/ By default an anchor is display inline, which is great when it appears amonst text. But as a button it needs to be able to display as a button with extra padding inside it. To do this we use inline-block<\/li>\n<li><strong>text-decoration: none;\u00a0\/\/ <\/strong>The browser adds an underline to all links, so we need to remove this (if we want)<\/li>\n<li><strong>padding: 10px 20px;\u00a0<\/strong>\/\/ Padding should typically be less on top and bottom than left and right. So we set top\/bottom to 10px and left\/right to 20px. We use padding\u00a0<strong>on the anchor\u00a0<\/strong>because we want the clickable area to be nice and large. If we used margin, or added padding to the wrapping element, the clickable area would\u00a0<strong>only be the text of the anchor<\/strong><\/li>\n<li><strong>color: white;\u00a0<\/strong>\/\/ Changing the text color<\/li>\n<li><strong>background: black;\u00a0<\/strong>\/\/ Changing the background color<\/li>\n<\/ol>\n<p id=\"SvNxWga\"><img loading=\"lazy\" decoding=\"async\" width=\"458\" height=\"238\" class=\"alignnone size-full wp-image-433 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034dc7c40e2.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034dc7c40e2.png 458w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034dc7c40e2-300x156.png 300w\" sizes=\"auto, (max-width: 458px) 100vw, 458px\" \/><\/p>\n<p>Let&#8217;s review what we have so far:<\/p>\n<p id=\"MTksnax\"><img loading=\"lazy\" decoding=\"async\" width=\"1454\" height=\"702\" class=\"alignnone size-full wp-image-434 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e22afb65.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e22afb65.png 1454w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e22afb65-300x145.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e22afb65-768x371.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e22afb65-1024x494.png 1024w\" sizes=\"auto, (max-width: 1454px) 100vw, 1454px\" \/><\/p>\n<p>Great, the header is in great shape. Let&#8217;s move to the <strong>.main\u00a0<\/strong>element with the two columns. Step 1, make the immediate children display as columns:<\/p>\n<p id=\"mNKzcjC\"><img loading=\"lazy\" decoding=\"async\" width=\"352\" height=\"120\" class=\"alignnone size-full wp-image-435 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e8866ffa.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e8866ffa.png 352w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034e8866ffa-300x102.png 300w\" sizes=\"auto, (max-width: 352px) 100vw, 352px\" \/><\/p>\n<p>Now we need to add styling to the buttons in the left column navigation, almost identical to the ones in the header, but I want the buttons to be <strong>display block,\u00a0<\/strong>which will make them take up the full horizontal space in the left column. And add some spacing underneath with margin-bottom:<\/p>\n<p id=\"HHKdLZv\"><img loading=\"lazy\" decoding=\"async\" width=\"448\" height=\"270\" class=\"alignnone size-full wp-image-436 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f400ccf8.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f400ccf8.png 448w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f400ccf8-300x181.png 300w\" sizes=\"auto, (max-width: 448px) 100vw, 448px\" \/><\/p>\n<p>Result<\/p>\n<p id=\"fvarZqD\"><img loading=\"lazy\" decoding=\"async\" width=\"612\" height=\"538\" class=\"alignnone size-full wp-image-437 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f4f47f40.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f4f47f40.png 612w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034f4f47f40-300x264.png 300w\" sizes=\"auto, (max-width: 612px) 100vw, 612px\" \/><\/p>\n<p>Looking great, a couple more small styling improvements and we&#8217;re done.<\/p>\n<h3>Adding padding to our columns<\/h3>\n<p>We don&#8217;t want the right column to be directly touching the left column, so we can simply add some padding to the columns to give them a little breathing room:<\/p>\n<p id=\"VRJGigP\"><img loading=\"lazy\" decoding=\"async\" width=\"536\" height=\"110\" class=\"alignnone size-full wp-image-438 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034fb0dbc01.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034fb0dbc01.png 536w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b034fb0dbc01-300x62.png 300w\" sizes=\"auto, (max-width: 536px) 100vw, 536px\" \/><\/p>\n<p>Here we use a special css selector, by declaring each selector and then adding a comma between the next selector we can select multiple selectors and apply the same styling. So we&#8217;ll add 15px padding to the left column, right column, and the header. Result will look like this:<\/p>\n<p id=\"ZtrJMZC\"><img loading=\"lazy\" decoding=\"async\" width=\"1868\" height=\"708\" class=\"alignnone size-full wp-image-439 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035002477ea.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035002477ea.png 1868w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035002477ea-300x114.png 300w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035002477ea-768x291.png 768w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035002477ea-1024x388.png 1024w\" sizes=\"auto, (max-width: 1868px) 100vw, 1868px\" \/><\/p>\n<p>And now we just want to add a gray background to the left column:<\/p>\n<p id=\"TgfEOUC\"><img loading=\"lazy\" decoding=\"async\" width=\"370\" height=\"122\" class=\"alignnone size-full wp-image-440 \" src=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035024d30c2.png\" alt=\"\" srcset=\"https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035024d30c2.png 370w, https:\/\/ucsbwebdev.fzilla.com\/wp-content\/uploads\/2018\/05\/img_5b035024d30c2-300x99.png 300w\" sizes=\"auto, (max-width: 370px) 100vw, 370px\" \/><\/p>\n<p>Here is the final CSS code:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"css\">.header {\r\n    display: flex;\r\n    justify-content: space-between;\r\n    align-items: center;\r\n}\r\n\r\n.menu a {\r\n    display: inline-block;\r\n    text-decoration: none;\r\n    padding: 10px 20px;\r\n    color: white;\r\n    background: black;\r\n}\r\n\r\n.main {\r\n    display: flex;\r\n}\r\n\r\n.left-menu a {\r\n    display: block;\r\n    margin-bottom: 3px;\r\n    text-decoration: none;\r\n    padding: 10px 20px;\r\n    color: white;\r\n    background: black;\r\n}\r\n\r\n.left-col, .right-col, .header {\r\n    padding: 15px;\r\n}\r\n\r\n.left-col {\r\n    background: gray;\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>That&#8217;s it! You&#8217;ve created a basic website \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Building a simple website from scratch In this tutorial we&#8217;ll build the exact same website from the midterm. It contains the following elements: Header: With a logo and a menu The menu should have black buttons with white text A two column main element The left column should have a title and a vertical navigation [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406"}],"version-history":[{"count":5,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":445,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions\/445"}],"wp:attachment":[{"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ucsbwebdev.fzilla.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}