{"id":16339,"date":"2018-05-25T14:53:49","date_gmt":"2018-05-25T19:53:49","guid":{"rendered":"https:\/\/www.dotcom-tools.com\/blog\/?p=16339"},"modified":"2021-11-17T02:11:59","modified_gmt":"2021-11-17T08:11:59","slug":"simple-tips-for-beautiful-css-coding","status":"publish","type":"post","link":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/","title":{"rendered":"Simple Tips for Simply Beautiful CSS Coding"},"content":{"rendered":"<p><img loading=\"lazy\" class=\"aligncenter size-full wp-image-16341\" src=\"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg\" alt=\"\" width=\"900\" height=\"400\" srcset=\"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg 900w, https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding-350x156.jpg 350w, https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding-768x341.jpg 768w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/>Regardless of your web development project, CSS likely plays a crucial role. Also known as Cascading Style Sheets, CSS is responsible for giving your site visual appeal. If you were to think about website coding as a car, HTML is the frame and CSS is its interior and exterior design. Essentially, CSS is the interior designer responsible for giving your site the aesthetics of your imagination.<\/p>\n<p>While CSS is a unique coding language, which means you\u2019re capable of developing your own style and coding technique, there are several universal tips all programmers should understand. These simple <a href=\"https:\/\/www.dotcom-tools.com\/web-performance\/blog\/css-code-organization\/\" target=\"_blank\" rel=\"noopener\">tips for CSS<\/a> coding may seem small, but their impact on your workflow and rendered pages is anything but simple.<\/p>\n<h2>Tip #1 | Vector Assets for Victorious Designs!<\/h2>\n<p>In the quest to create the most optimized and performance-minded CSS code, you should not only look at how your code is written, but also the type of files it conjures. Consider using SVG (vector) assets when it comes to icons and other specific images. Not only does this file format reduce rendering time on your end-users browser, but vector assets help maintain clean and easily readable code.<\/p>\n<p>What\u2019s cool about vector assets, is you can manipulate the color of SVG icons directly within CSS using a declaration. This not only saves you time from having manually adjust SVG code through a photo editor, but it\u2019s far easier than trying to remember where you saved the newly created SVG icon file.<\/p>\n<h2>Tip #2 | CSS Comments for Easy-to-Read Code<\/h2>\n<p>In an attempt to make code as streamlined and lightweight as possible, many designers make the mistake of avoiding CSS comments. While it\u2019s true the density of written items within a CSS file enlarges its size, well-positioned comments won\u2019t distract from rendering speed.<\/p>\n<p>Essentially, a CSS comment is written to help you understand the code. Browsers don\u2019t use information within comments, which are text wrapped in the \/* COMMENT *\/ command line. This is extremely helpful when identifying specific selector-declaration compartments within a CSS stylesheet. Experiment with comments and see how much easier it is to review and understand your code.<\/p>\n<h2>Tip #3 | Updated Code? Delete Unused Declarations<\/h2>\n<p>As your website evolves and undergoes multiple changes, you\u2019re bound to have lines of CSS that are no longer applicable. In an attempt to keep your code simple to read and debug, take time with every update to review and eliminate unused code. Even if you plan on using the <a href=\"https:\/\/css-tricks.com\/snippets\/\" target=\"_blank\" rel=\"noopener\">code snippet<\/a> in the future, delete the snippet form the stylesheet and save in another file for future use.<\/p>\n<h3>Tip #4 | No (no) Duplicate (duplicate) Code (code)<\/h3>\n<p>This is a common problem when you\u2019re dealing with old code that\u2019s been manipulated by several coders. Sometimes duplicate code finds its way into your stylesheet, and while it may not be causing on-page rendering issues, it\u2019s simply not beautiful. Spend time reviewing your stylesheet and eliminate all duplicate code.<\/p>\n<p>While you\u2019re looking for simple tips for CSS coding, determine if there\u2019s any way to combine and bundle selectors and declarations. For example, do you use the same declaration for header tags? If so, combine all header selectors (h1, h2, h3, etc) and separate them by commas before the declaration. Now, delete the unnecessary selectors-declarations. Suddenly, you have a more efficient and visually pleasing code!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Regardless of your web development project, CSS likely plays a crucial role. Also known as Cascading Style Sheets, CSS is responsible for giving your site visual appeal. If you were to think about website coding as a car, HTML is the frame and CSS is its interior and exterior design. Essentially, CSS is the interior&hellip;<\/p>\n","protected":false},"author":5,"featured_media":16341,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-url.php","format":"standard","meta":[],"categories":[75],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.6 (Yoast SEO v19.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\r\n<title>Simple Tips for Simply Beautiful CSS Coding | Dotcom-Monitor Tools Blog<\/title>\r\n<meta name=\"description\" content=\"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.\" \/>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/\" \/>\r\n<meta property=\"og:locale\" content=\"en_US\" \/>\r\n<meta property=\"og:type\" content=\"article\" \/>\r\n<meta property=\"og:title\" content=\"Simple Tips for Simply Beautiful CSS Coding\" \/>\r\n<meta property=\"og:description\" content=\"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.\" \/>\r\n<meta property=\"og:url\" content=\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/\" \/>\r\n<meta property=\"og:site_name\" content=\"Dotcom-Monitor Tools Blog\" \/>\r\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dotcommonitor\" \/>\r\n<meta property=\"article:published_time\" content=\"2018-05-25T19:53:49+00:00\" \/>\r\n<meta property=\"article:modified_time\" content=\"2021-11-17T08:11:59+00:00\" \/>\r\n<meta property=\"og:image\" content=\"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg\" \/>\r\n\t<meta property=\"og:image:width\" content=\"900\" \/>\r\n\t<meta property=\"og:image:height\" content=\"400\" \/>\r\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\r\n<meta name=\"twitter:card\" content=\"summary\" \/>\r\n<meta name=\"twitter:creator\" content=\"@dotcom_monitor\" \/>\r\n<meta name=\"twitter:site\" content=\"@dotcom_monitor\" \/>\r\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Glenn Lee\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/#website\",\"url\":\"https:\/\/www.dotcom-tools.com\/web-performance\/\",\"name\":\"Dotcom-Monitor Tools Blog\",\"description\":\"Let&#039;s Make the Web a Faster Place.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dotcom-tools.com\/web-performance\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#primaryimage\",\"url\":\"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg\",\"contentUrl\":\"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg\",\"width\":900,\"height\":400,\"caption\":\"Simple Tips for CSS Coding\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#webpage\",\"url\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/\",\"name\":\"Simple Tips for Simply Beautiful CSS Coding | Dotcom-Monitor Tools Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#primaryimage\"},\"datePublished\":\"2018-05-25T19:53:49+00:00\",\"dateModified\":\"2021-11-17T08:11:59+00:00\",\"author\":{\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/a18124e28e1b2c8e71f8ddf7d3e38ed4\"},\"description\":\"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.dotcom-tools.com\/web-performance\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Simple Tips for Simply Beautiful CSS Coding\"}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/a18124e28e1b2c8e71f8ddf7d3e38ed4\",\"name\":\"Glenn Lee\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7a52a01e153d000504984c4f0853f002?s=96&d=retro&r=pg\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7a52a01e153d000504984c4f0853f002?s=96&d=retro&r=pg\",\"caption\":\"Glenn Lee\"},\"description\":\"Glenn Lee is the chief product engineer for Dotcom-Monitor\u2019s LoadView load testing platform. Glenn is an industry expert on load\/stress testing and has appeared on numerous tech publications across the web. When Glenn\u2019s not testing the limits of websites, he enjoys cooking, flying airplanes, and racing motorcycles.\",\"url\":\"https:\/\/www.dotcom-tools.com\/web-performance\/author\/glenn-lee\/\"}]}<\/script>\r\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Simple Tips for Simply Beautiful CSS Coding | Dotcom-Monitor Tools Blog","description":"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.","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:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/","og_locale":"en_US","og_type":"article","og_title":"Simple Tips for Simply Beautiful CSS Coding","og_description":"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.","og_url":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/","og_site_name":"Dotcom-Monitor Tools Blog","article_publisher":"https:\/\/www.facebook.com\/dotcommonitor","article_published_time":"2018-05-25T19:53:49+00:00","article_modified_time":"2021-11-17T08:11:59+00:00","og_image":[{"width":900,"height":400,"url":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg","type":"image\/jpeg"}],"twitter_card":"summary","twitter_creator":"@dotcom_monitor","twitter_site":"@dotcom_monitor","twitter_misc":{"Written by":"Glenn Lee","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/#website","url":"https:\/\/www.dotcom-tools.com\/web-performance\/","name":"Dotcom-Monitor Tools Blog","description":"Let&#039;s Make the Web a Faster Place.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dotcom-tools.com\/web-performance\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#primaryimage","url":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg","contentUrl":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-content\/uploads\/2018\/05\/Tips-for-Beautiful-CSS-Coding.jpg","width":900,"height":400,"caption":"Simple Tips for CSS Coding"},{"@type":"WebPage","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#webpage","url":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/","name":"Simple Tips for Simply Beautiful CSS Coding | Dotcom-Monitor Tools Blog","isPartOf":{"@id":"https:\/\/www.dotcom-tools.com\/web-performance\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#primaryimage"},"datePublished":"2018-05-25T19:53:49+00:00","dateModified":"2021-11-17T08:11:59+00:00","author":{"@id":"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/a18124e28e1b2c8e71f8ddf7d3e38ed4"},"description":"These simple tips for CSS coding may seem small, but their impact on your workflow and rendered pages is anything but simple. While CSS is a unique coding language, you are capable of developing your own style and coding technique.","breadcrumb":{"@id":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/simple-tips-for-beautiful-css-coding\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dotcom-tools.com\/web-performance\/"},{"@type":"ListItem","position":2,"name":"Simple Tips for Simply Beautiful CSS Coding"}]},{"@type":"Person","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/a18124e28e1b2c8e71f8ddf7d3e38ed4","name":"Glenn Lee","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dotcom-tools.com\/web-performance\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7a52a01e153d000504984c4f0853f002?s=96&d=retro&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7a52a01e153d000504984c4f0853f002?s=96&d=retro&r=pg","caption":"Glenn Lee"},"description":"Glenn Lee is the chief product engineer for Dotcom-Monitor\u2019s LoadView load testing platform. Glenn is an industry expert on load\/stress testing and has appeared on numerous tech publications across the web. When Glenn\u2019s not testing the limits of websites, he enjoys cooking, flying airplanes, and racing motorcycles.","url":"https:\/\/www.dotcom-tools.com\/web-performance\/author\/glenn-lee\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/posts\/16339"}],"collection":[{"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/comments?post=16339"}],"version-history":[{"count":5,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/posts\/16339\/revisions"}],"predecessor-version":[{"id":17772,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/posts\/16339\/revisions\/17772"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/media\/16341"}],"wp:attachment":[{"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/media?parent=16339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/categories?post=16339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dotcom-tools.com\/web-performance\/wp-json\/wp\/v2\/tags?post=16339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}