{"id":761,"date":"2020-01-04T18:40:06","date_gmt":"2020-01-04T23:40:06","guid":{"rendered":"http:\/\/newmediaproduction.mynmi.net\/?page_id=761"},"modified":"2022-06-08T19:58:40","modified_gmt":"2022-06-08T19:58:40","slug":"fonts","status":"publish","type":"page","link":"https:\/\/nmi.cool\/web\/fonts\/","title":{"rendered":"Fonts"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"1707\" src=\"https:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1.jpg\" alt=\"\" class=\"wp-image-2384\" srcset=\"https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1.jpg 2560w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1-300x200.jpg 300w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1-1024x683.jpg 1024w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1-768x512.jpg 768w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1-1536x1024.jpg 1536w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/tim-mossholder-GOMhuCj-O9w-unsplash-scaled-1-2048x1366.jpg 2048w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><figcaption>Photo by&nbsp;<a href=\"https:\/\/unsplash.com\/@timmossholder?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText\">Tim Mossholder<\/a>.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>1. Font-family property<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\"> body {font-family: Arial, Verdana, sans-serif;}<\/pre>\n\n\n\n<p>When you type in font-family in your CSS, you\u2019ll see a variety of different fonts at your disposal. To display these fonts on your website, users looking at your site will need to have these fonts installed on their computers. If the user doesn\u2019t have the first font listed (in the example above, Arial) installed, the browser will try to display the next font, then the next, and so on. If you\u2019re wondering, sans-serif and serif refer to two very broad categories of fonts\u2014read this <a href=\"https:\/\/www.impactbnd.com\/blog\/sans-serif-vs-serif-font-which-should-you-use-when\">article<\/a> to learn more.<\/p>\n\n\n\n<p>Note: If a font is more than one word, it must be placed in double-quotes, ie, \u201cTimes New Roman.\u201d <\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"google-fonts\">2. Google Fonts&nbsp;<\/h2>\n\n\n\n<p>Google Fonts can easily be imported to your website. To use Google Fonts you&#8217;ll you add a special stylesheet link in the <code>&lt;head&gt;<\/code> of your HTML document.&nbsp;<\/p>\n\n\n\n<p>An important aspect of this class is learning how to help yourself\u2014there are tons of free, online resources to help with web development. In this case, <a href=\"https:\/\/developers.google.com\/fonts\/docs\/getting_started\">Google\u2019s instructions<\/a> are better than any I can devise, or you can do <strong>the Free Code Camp homework dedicated to Google Fonts, too (Responsive Web Design &gt; Basic CSS &gt; Import a Google Font). <\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Test it out! <\/h3>\n\n\n\n<p>Go ahead and test this out in Visual Studio Code. First, you&#8217;ll need to create a test HTML file&#8211; you can call it <code>fonts.html<\/code> if you like! Since this is just a practice document, you won&#8217;t need to upload it to your server, so save it wherever you save your practice files for this class. Generate your HTML boilerplate. Next, you&#8217;ll want to create a blank CSS document named <code>style.css<\/code> and save it in a folder that you will name <code>css<\/code>. It&#8217;s a good idea if that folder is in the same directory level as your font.html document. Make sure to <a href=\"https:\/\/nmi.cool\/web\/linking-to-an-external-stylesheet\/\" target=\"_blank\" rel=\"noreferrer noopener\">link your external stylesheet<\/a> in the &lt;head> of your HTML document. Okay, now we are ready to go!  <\/p>\n\n\n\n<p>Open <a rel=\"noreferrer noopener\" href=\"https:\/\/fonts.google.com\" target=\"_blank\">Google Fonts<\/a> in a web browser. Spend a couple minutes browsing the font options and click on one you like. Your font might have multiple styles; select the one (or more!) that you like by clicking the blue &#8220;+select this style&#8221; button. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1378\" height=\"372\" src=\"https:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.55.02-PM.png\" alt=\"\" class=\"wp-image-2387\" srcset=\"https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.55.02-PM.png 1378w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.55.02-PM-300x81.png 300w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.55.02-PM-1024x276.png 1024w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.55.02-PM-768x207.png 768w\" sizes=\"auto, (max-width: 1378px) 100vw, 1378px\" \/><\/figure>\n\n\n\n<p>The selected family will appear on the right side of your screen. Click embed. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"342\" height=\"514\" src=\"http:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.58.28-PM.png\" alt=\"click &quot;embed.&quot;\" class=\"wp-image-2388\" srcset=\"https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.58.28-PM.png 342w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-8.58.28-PM-200x300.png 200w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" \/><\/figure>\n<\/div>\n\n\n<p>Make sure &lt;link&gt; (rather than @import) is selected and copy the <code>&lt;link&gt;<\/code> code and paste it into the head of your HTML document right above the your external stylesheet. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"476\" height=\"522\" src=\"http:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.37.31-PM.png\" alt=\"\" class=\"wp-image-2393\" srcset=\"https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.37.31-PM.png 476w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.37.31-PM-274x300.png 274w\" sizes=\"auto, (max-width: 476px) 100vw, 476px\" \/><\/figure>\n<\/div>\n\n\n<p>You&#8217;ll want to add a little content to this webpage so we can apply the font. Go ahead and add a heading or two, a paragraph&#8211; whatever you like. <\/p>\n\n\n\n<p>Now that you&#8217;ve got a little content, pick an element that you&#8217;d like to apply the font too&#8211; maybe a paragraph or heading. In your style sheet, add a selector. <\/p>\n\n\n\n<p>Next, copy and paste the CSS rule from Google Fonts (it&#8217;s right under that link you copied) into your stylesheet. <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"473\" height=\"505\" src=\"http:\/\/nmi.cool\/newmediaproduction\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.38.09-PM.png\" alt=\"\" class=\"wp-image-2394\" srcset=\"https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.38.09-PM.png 473w, https:\/\/nmi.cool\/web\/wp-content\/uploads\/sites\/3\/2020\/09\/Screen-Shot-2020-09-14-at-9.38.09-PM-281x300.png 281w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/figure>\n<\/div>\n\n\n<p>Your stylesheet should look something like this: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">p {\n     font-family: 'Raleway', sans-serif;\n   }<\/pre>\n\n\n\n<p>That&#8217;s it! Save both your HTML and CSS files and give the HTML file a preview in Chrome. You should see the font on your screen. <\/p>\n\n\n\n<p>Feel free to practice some of your CSS skills and have a little fun here: maybe add a <a href=\"https:\/\/nmi.cool\/web\/intro-css\/#color\" target=\"_blank\" rel=\"noreferrer noopener\">color<\/a>, change the font-size, or test out some of the <a rel=\"noreferrer noopener\" href=\"https:\/\/developers.google.com\/fonts\/docs\/getting_started#enabling_font_effects_beta\" target=\"_blank\">Google Font Effects<\/a>.<a href=\"#footnote-1-761\" id=\"note-1-761\" rel=\"footnote\">1<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Selecting fonts<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>Less is more: typically, designers stick to <strong>three fonts<\/strong>. <\/li><li>Look at free resources for font pairings, such as <a rel=\"noreferrer noopener\" aria-label=\"fontpair.co (opens in a new tab)\" href=\"https:\/\/fontpair.co\/\" target=\"_blank\">fontpair.co<\/a> and <a rel=\"noreferrer noopener\" aria-label=\"fontjoy.com (opens in a new tab)\" href=\"https:\/\/fontjoy.com\/\" target=\"_blank\">fontjoy.com<\/a>. Try to not pick fonts randomly; every design choice should serve a purpose. Comic sans is not an appropriate font for a small business site, for instance. <\/li><li>When it comes to picking font sizes, pay attention to the <a rel=\"noreferrer noopener\" aria-label=\"typographic scale (opens in a new tab)\" href=\"http:\/\/spencermortensen.com\/articles\/typographic-scale\/\" target=\"_blank\">typographic scale<\/a>\u2014the size of fonts and how they work in relation to each other. Check out typographic scales like <a rel=\"noreferrer noopener\" aria-label=\"type-scale.com (opens in a new tab)\" href=\"https:\/\/type-scale.com\/\" target=\"_blank\">type-scale.com<\/a>.<\/li><\/ul>\n<div class=\"footnotes\"><hr \/><ol><li id=\"footnote-1-761\" class=\"footnote\"><p> Go easy with these, they are a fun but a little&#8230; intense and could make it hard to read your text if you aren&#8217;t careful<a href=\"#note-1-761\" class=\"footnote-return\">&#8617;<\/a><\/p><\/li><!--\/#footnote-1.footnote--><\/ol><\/div><!--\/#footnotes-->","protected":false},"excerpt":{"rendered":"<p>1. Font-family property body {font-family: Arial, Verdana, sans-serif;} When you type in font-family in your CSS, you\u2019ll see a variety of different fonts at your disposal. To display these fonts on your website, users looking at your site will need to have these fonts installed on their computers. If the user doesn\u2019t have the first &hellip; <a href=\"https:\/\/nmi.cool\/web\/fonts\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Fonts<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-761","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/pages\/761","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/comments?post=761"}],"version-history":[{"count":4,"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/pages\/761\/revisions"}],"predecessor-version":[{"id":3592,"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/pages\/761\/revisions\/3592"}],"wp:attachment":[{"href":"https:\/\/nmi.cool\/web\/wp-json\/wp\/v2\/media?parent=761"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}