{"id":21632,"date":"2020-08-25T17:35:25","date_gmt":"2020-08-26T00:35:25","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=21632"},"modified":"2020-12-29T11:34:01","modified_gmt":"2020-12-29T19:34:01","slug":"css-font-style","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/css-font-style\/","title":{"rendered":"CSS Font-Style"},"content":{"rendered":"\n<p>With the <code>font-style<\/code> CSS property we can style our font with a set of characteristics in order to give emphasis to our text.&nbsp;<\/p>\n\n\n\n<p>As always, checkout my <a href=\"https:\/\/codepen.io\/fbohz-the-decoder\/pen\/xxVgKoe\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">Codepen<\/a> so you can code-along with me.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>font-style<\/strong><strong> Syntax and Options<\/strong><\/h2>\n\n\n\n<p>We have the following options when using <code>font-style<\/code>. Note, all of them are specified as keywords.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>font-style: normal;\nfont-style: italic;\nfont-style: oblique 30deg;\nfont-style: oblique;<\/pre><\/div>\n\n\n\n<p>Font-style also supports some common global style keywords.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\/* inherit from parent element *\/\nfont-style: inherit;\n\/* browser's default *\/\nfont-style: initial;\n\/* inherit if parent value, else initial *\/\nfont-style: unset;<\/pre><\/div>\n\n\n\n<p>The normal relates to the normal font within your specified <code>font-family<\/code>.<\/p>\n\n\n\n<p>With oblique we can optionally specify the angle (-90 to 90) and if no angle is specified it will default to 14.&nbsp;<\/p>\n\n\n\n<p><strong>Note that oblique and italic can be interchangeable<\/strong>. This is because of <strong>browser support<\/strong> and if you are using a special font and if the browser doesn&#8217;t find or support oblique will use italic and so on.<\/p>\n\n\n\n<p>Before using <code>oblique<\/code>, do check whether the oblique keyword is <a href=\"https:\/\/caniuse.com\/#search=oblique\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">fully supported<\/a> on your browser.<\/p>\n\n\n\n<p>With that in mind, let&#8217;s go ahead and add emphasis to our h1 title:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>h1.title {\n  font-family: 'Tangerine';\n  font-style: normal;\n}<\/pre><\/div>\n\n\n\n<p>You&#8217;ll notice how we imported the Tangerine font from Google fonts, this font normal style is cursive so it is displayed as such.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/4Nppozeom2XRYMA394qXy4vo7f0fM4Z9lemdp7675jSJuORwC7id8bx1-zMwVqx4FNyAA4hC3B9pU5JuSnda-VqE5Y00-BZGbbGxj0sKwuEU0G-i7_BasksSmqkM6PoHJSsZf0xG\" alt=\"Screen Shot 2020-08-22 at 4 42 19 PM\"\/><\/figure>\n\n\n\n<p>For this particular font, making it cursive will slant it more, so we probably wouldn&#8217;t wanna apply.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Main Use of <\/strong><strong>font-style<\/strong><\/h2>\n\n\n\n<p>In most cases using the normal keyword is redundant. So the main use of the <code>font-style<\/code> property is to make the font italic to add emphasis.<\/p>\n\n\n\n<p>In order to add emphasis to a paragraph, let&#8217;s make one of them italic.<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>p.par {\n  font-family: 'Indie Flower';\n  font-style: italic;\n}<\/pre><\/div>\n\n\n\n<p>If you check out the <a href=\"https:\/\/fonts.google.com\/specimen\/Indie+Flower?category=Sans+Serif,Display,Handwriting&amp;sidebar.open=true&amp;selection.family=Indie+Flower#standard-styles\" target=\"_blank\" rel=\"noopener\" rel=\"nofollow\">Indie Flower<\/a> font, you&#8217;ll notice it only has the regular (normal) style. In this case the browser itself is doing the sloping effect!<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/mhe2kocgrTVdQvnSPkNwX_kOdqoPjh56g1ozZrIQWyHquvtMmoW654YEOKIPj2R4r0FUKVo46Wf3UTw975somgJrHl_5GIJfs_brJF5q1HeK3yZBtG0Iq7ce6-JH1v3uaFvpZyfd\" alt=\"Screen Shot 2020-08-22 at 5 18 42 PM\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Using the <code>font-style<\/code> property is deeply linked with <code>font-family<\/code>. Also, until there&#8217;s better browser support of the <code>oblique<\/code> keyword, the main use of this property would be to add emphasis on fonts by making them italic.<\/p>\n","protected":false},"excerpt":{"rendered":"With the font-style CSS property we can style our font with a set of characteristics in order to give emphasis to our text.&nbsp; As always, checkout my Codepen so you can code-along with me. font-style Syntax and Options We have the following options when using font-style. Note, all of them are specified as keywords. font-style:&hellip;","protected":false},"author":86,"featured_media":21390,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[17287],"tags":[],"class_list":{"0":"post-21632","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-css"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"CSS","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>The Font-Style CSS Property: Complete Guide | Career Karma<\/title>\n<meta name=\"description\" content=\"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/css-font-style\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CSS Font-Style\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/css-font-style\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-26T00:35:25+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-12-29T19:34:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"967\" \/>\n\t<meta property=\"og:image:height\" content=\"725\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Felipe Boh\u00f3rquez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Felipe Boh\u00f3rquez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/\"},\"author\":{\"name\":\"Felipe Boh\u00f3rquez\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220\"},\"headline\":\"CSS Font-Style\",\"datePublished\":\"2020-08-26T00:35:25+00:00\",\"dateModified\":\"2020-12-29T19:34:01+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/\"},\"wordCount\":311,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg\",\"articleSection\":[\"CSS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/css-font-style\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/\",\"name\":\"The Font-Style CSS Property: Complete Guide | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg\",\"datePublished\":\"2020-08-26T00:35:25+00:00\",\"dateModified\":\"2020-12-29T19:34:01+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220\"},\"description\":\"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/css-font-style\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg\",\"width\":967,\"height\":725},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/css-font-style\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CSS\",\"item\":\"https:\/\/careerkarma.com\/blog\/css\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"CSS Font-Style\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220\",\"name\":\"Felipe Boh\u00f3rquez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-17-at-11.10.42-AM-150x150.png\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-17-at-11.10.42-AM-150x150.png\",\"caption\":\"Felipe Boh\u00f3rquez\"},\"description\":\"Felipe Boh\u00f3rquez is a Software Engineer and technical writer at Career Karma. He covers all things frontend and backend development.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/felipe-bohorquez\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The Font-Style CSS Property: Complete Guide | Career Karma","description":"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.","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:\/\/careerkarma.com\/blog\/css-font-style\/","og_locale":"en_US","og_type":"article","og_title":"CSS Font-Style","og_description":"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.","og_url":"https:\/\/careerkarma.com\/blog\/css-font-style\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-26T00:35:25+00:00","article_modified_time":"2020-12-29T19:34:01+00:00","og_image":[{"width":967,"height":725,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg","type":"image\/jpeg"}],"author":"Felipe Boh\u00f3rquez","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"Felipe Boh\u00f3rquez","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/"},"author":{"name":"Felipe Boh\u00f3rquez","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220"},"headline":"CSS Font-Style","datePublished":"2020-08-26T00:35:25+00:00","dateModified":"2020-12-29T19:34:01+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/"},"wordCount":311,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg","articleSection":["CSS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/css-font-style\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/","url":"https:\/\/careerkarma.com\/blog\/css-font-style\/","name":"The Font-Style CSS Property: Complete Guide | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg","datePublished":"2020-08-26T00:35:25+00:00","dateModified":"2020-12-29T19:34:01+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220"},"description":"Learn how to use the CSS font-style property and how we can add emphasis to text. Learn CSS with Career Karma.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/css-font-style\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/pasted-image-0-2020-08-18T221925.148.jpg","width":967,"height":725},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/css-font-style\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CSS","item":"https:\/\/careerkarma.com\/blog\/css\/"},{"@type":"ListItem","position":3,"name":"CSS Font-Style"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e2cbf72dcbfaf9e81a8b6a38c1bd4220","name":"Felipe Boh\u00f3rquez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-17-at-11.10.42-AM-150x150.png","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-17-at-11.10.42-AM-150x150.png","caption":"Felipe Boh\u00f3rquez"},"description":"Felipe Boh\u00f3rquez is a Software Engineer and technical writer at Career Karma. He covers all things frontend and backend development.","url":"https:\/\/careerkarma.com\/blog\/author\/felipe-bohorquez\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/86"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=21632"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21632\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/21390"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=21632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=21632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=21632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}