{"id":41707,"date":"2025-08-28T21:23:26","date_gmt":"2025-08-28T18:23:26","guid":{"rendered":"https:\/\/coma.lv\/2025\/08\/28\/what-is-css\/"},"modified":"2025-08-28T21:23:26","modified_gmt":"2025-08-28T18:23:26","slug":"what-is-css","status":"publish","type":"post","link":"https:\/\/coma.lv\/en\/2025\/08\/28\/what-is-css\/","title":{"rendered":"What Is CSS"},"content":{"rendered":"\n<p style=\"text-align: left;\" data-start=\"335\" data-end=\"802\">CSS, or Cascading Style Sheets, is the language used to describe the appearance and formatting of HTML documents. With CSS you can define styling, colors, fonts, sizes, the layout of elements and how the interface behaves on different devices. WordPress themes use CSS and HTML to output the data generated by the system. Every WordPress theme contains a <strong data-start=\"721\" data-end=\"734\">style.css<\/strong> file, which holds the rules and styles that define how pages look.<\/p>\n<p style=\"text-align: left;\" data-start=\"804\" data-end=\"1076\">CSS remains simple to learn and use. There are many resources and online tutorials that help you master the basics from scratch. WordPress users can quickly grasp the principles simply by opening the theme&#8217;s <strong data-start=\"1030\" data-end=\"1043\">style.css<\/strong> file and looking at how the styles are defined.<\/p>\n<p style=\"text-align: left;\"><strong>Example:<\/strong><\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\nbody {\r\n  font-size: 16px;\r\n  color: #333;\r\n  background-color: #fff;\r\n  font-family: system-ui, -apple-system, &amp;quot;Segoe UI&amp;quot;, Roboto, sans-serif;\r\n  line-height: 1.6;\r\n}\r\n\r\nh1 {\r\n  font-size: clamp(1.5rem, 2vw, 2rem);\r\n  text-transform: uppercase;\r\n  letter-spacing: 0.05em;\r\n}\r\n\r\n.post-title {\r\n  font-size: 1.25rem;\r\n  color: #4c0000;\r\n  font-weight: 500;\r\n}\r\n\r\n<\/pre>\n<p style=\"text-align: left;\">HTML elements can get their styling directly from CSS. Designers use <strong data-start=\"1519\" data-end=\"1537\">IDs<\/strong> and <strong data-start=\"1540\" data-end=\"1550\">classes<\/strong> to set different parameters for individual sections or repeated blocks on a page. This helps apply different styles to the same HTML element in different places on the site. For example, a blog heading can look different from a post heading.<\/p>\n<p style=\"text-align: left;\"><strong>HTML example:<\/strong><\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&amp;lt;div id=&amp;quot;header&amp;quot;&amp;gt;\r\n  &amp;lt;h1 class=&amp;quot;blog-title&amp;quot;&amp;gt;\r\n    &amp;lt;a href=&amp;quot;&amp;lt;?php bloginfo(&amp;#039;url&amp;#039;); ?&amp;gt;&amp;quot; title=&amp;quot;&amp;lt;?php bloginfo(&amp;#039;name&amp;#039;); ?&amp;gt;&amp;quot;&amp;gt;\r\n      &amp;lt;?php bloginfo(&amp;#039;name&amp;#039;); ?&amp;gt;\r\n    &amp;lt;\/a&amp;gt;\r\n  &amp;lt;\/h1&amp;gt;\r\n&amp;lt;\/div&amp;gt;\r\n<\/pre>\n<p style=\"text-align: left;\">The HTML shown above contains the ID <em>\u2018header\u2019<\/em>  and the class <em>\u2018blog-title\u2019<\/em>. These sections can be styled with CSS.<\/p>\n<p style=\"text-align: left;\"><strong>CSS example:<\/strong><\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n#header {\r\n  background-color: #4c0000;\r\n  padding: 2rem;\r\n  display: flex;\r\n  align-items: center;\r\n  justify-content: center;\r\n}\r\n\r\nh1.blog-title a {\r\n  color: #fff;\r\n  font-size: 1.5rem;\r\n  font-family: Georgia, &amp;quot;Times New Roman&amp;quot;, serif;\r\n  text-decoration: none;\r\n}\r\n\r\n<\/pre>\n<p style=\"text-align: left;\" data-start=\"2317\" data-end=\"2532\">CSS lets you create not only basic styling but also flexible, responsive layouts. Modern sites use <strong data-start=\"2432\" data-end=\"2443\">Flexbox<\/strong> and <strong data-start=\"2446\" data-end=\"2458\">CSS Grid<\/strong> so that elements automatically adapt to different screen sizes.<\/p>\n<p style=\"text-align: left;\" data-start=\"2534\" data-end=\"2563\"><strong>Example of a responsive block:<\/strong><\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n.posts {\r\n  display: grid;\r\n  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));\r\n  gap: 1.5rem;\r\n  padding: 1rem;\r\n}\r\n\r\n<\/pre>\n<p style=\"text-align: left;\" data-start=\"2700\" data-end=\"2821\">This example uses a grid that rearranges itself neatly on mobile devices without any extra code.<\/p>\n<p style=\"text-align: left;\" data-start=\"2823\" data-end=\"2929\">In addition, CSS lets you define <strong data-start=\"2856\" data-end=\"2870\">variables<\/strong>, which makes styles easier to maintain and design systems easier to build:<\/p>\n<pre class=\"brush: css; title: ; notranslate\" title=\"\">\r\n:root {\r\n  --color-primary: #4c0000;\r\n  --color-text: #333;\r\n}\r\n\r\nbody {\r\n  color: var(--color-text);\r\n}\r\n\r\na {\r\n  color: var(--color-primary);\r\n}\r\n\r\n<\/pre>\n<p style=\"text-align: left;\">CSS has become the foundation of the visual side of the Internet, allowing designers and developers to create fast, responsive and beautiful websites.<\/p>\n<hr \/>\n<p style=\"text-align: left;\"><em>Our specialization is WordPress website development and maintenance. Contact us for a free consultation \u2014 <a href=\"mailto:vadim@coma.lv\">vadim@coma.lv<\/a>, <a href=\"tel:+37129394520\">+371 29394520<\/a><\/em><\/p>\n<hr \/>\n","protected":false},"excerpt":{"rendered":"<p>CSS, or Cascading Style Sheets, is the language used to describe the appearance and formatting of HTML documents. With CSS you can define styling, colors, fonts, sizes, the layout of elements and how the interface behaves on different devices. WordPress themes use CSS and HTML to output the data generated by the system. Every WordPress [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":37871,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1225,1405],"tags":[],"class_list":["post-41707","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress","category-terms"],"_links":{"self":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts\/41707","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/comments?post=41707"}],"version-history":[{"count":0,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/posts\/41707\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/media\/37871"}],"wp:attachment":[{"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/media?parent=41707"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/categories?post=41707"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coma.lv\/en\/wp-json\/wp\/v2\/tags?post=41707"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}