Skip to the content
Start free

What is CSS?

CSS (Cascading Style Sheets) is the language that tells a browser how a web page should look: colours, fonts, spacing, layout and motion. HTML says what is on the page; CSS says how it is shown. For search and AI, CSS matters in three ways: it changes how fast a page appears, whether content is visible, and how the page looks on a phone.

What is CSS? #

MDN describes CSS as “a stylesheet language used to describe the presentation of a document” written in HTML or XML. It covers how elements are shown on screen, on paper, in speech and on other media. The W3C says CSS is used for “adding style (e.g., fonts, colors, spacing) to Web documents”. Its CSS Working Group writes the standards. Every browser reads it. See HTTP for how the files arrive.

What does a CSS rule look like? #

MDN explains that a rule starts with a selector, which picks the HTML elements to style. Then comes a block in curly brackets with one or more declarations. Each declaration is a property and a value.

h2 {
  color: #1a1a1a;
  font-size: 1.5rem;
}

Here h2 is the selector, color is a property and #1a1a1a is its value. CSS can live in a separate .css file, in a <style> block in the page, or on one element.

What does “cascading” mean? #

Many rules can apply to the same element. The cascade is the set of rules that decides which one wins. In short: a more specific selector beats a general one, and a later rule beats an earlier one of equal weight. This is why a change in one file can break a page somewhere else. It is also why a page can look fine to you and different to a visitor whose browser loaded an older file.

Is there a CSS3 or CSS4? #

No. MDN says “There will never be a CSS3 or a CSS4”. CSS is now one language made of modules, and each module has its own level, such as CSS Color Module Level 5. The W3C publishes a yearly snapshot that lists the parts “ready for implementers”.

Google renders pages to see them as people do. Its JavaScript guide says Google Search uses “an evergreen version of Chromium” to do it. Its robots.txt guide warns that if blocking a resource makes the page “harder for Google’s crawler to understand”, you should not block it. Blocked CSS can make a good mobile page look broken to Google. See robots.txt and mobile SEO.

Does CSS change titles in Google? #

It can. Google builds title links mainly from the <title> element. But its list of sources also includes “other content that’s large and prominent through the use of style treatments”. So text that CSS makes big and bold near the top can end up in your title link. Keep your main heading and your title saying the same thing.

How does CSS affect page speed? #

web.dev says “CSS files are render-blocking resources”: the browser must load and process them before it shows the page. Large style sheets slow the first paint. A style sheet that applies only when the page is printed does not need to block the first view, so print rules belong in their own file, marked for print. The fix web.dev shows is to inline the small amount of CSS needed for the top of the page and load the rest later. In its demo, 55.9% of the CSS file was unused. See page speed, Largest Contentful Paint and why your website is slow.

How does CSS affect layout shift? #

Cumulative Layout Shift measures how much the page jumps while it loads. web.dev says a good score is 0.1 or less at the 75th percentile of page loads. Causes include images with no set size and fonts that render bigger or smaller than the fallback. For movement, web.dev advises transform: translate() rather than changing top or left. See Core Web Vitals.

Why does CSS matter for AI answers? #

Text styled by CSS is still text in the HTML. That is good: a search crawler or AI crawler that reads raw HTML, and one that renders the page, both get the words. The exception is text that CSS adds itself with ::before. It is not part of the HTML document, so a crawler reading raw HTML never sees it, and MDN says adding content this way is “not reliably accessible to screen readers”. The risk is in the other direction. Google says it “doesn’t index CSS images”, so a picture set as a CSS background is invisible to image search. Words drawn inside a background image cannot be quoted at all. Put facts in text and pictures in <img> with alt text. See AI crawler and image SEO.

When is hidden text a problem? #

When the aim is to fool search engines. Google’s spam policies list “Using CSS to position text off-screen” and setting the font size or opacity to 0 as hidden text abuse. They also say accordions, tabs, sliders, tooltips and text only for screen readers are fine. On phones, Google’s mobile-first guide allows accordions or tabs, if the content matches desktop. See cloaking and black hat SEO.

How does CSS make a page work on phones? #

With media queries. MDN says they test things like screen width and “apply CSS selectively”. Responsive design also needs the viewport meta tag. Google recommends Responsive Web Design: the same HTML at the same address for every device, with CSS changing the layout. Google indexes the mobile version first. See mobile-first indexing.

Does CSS affect accessibility? #

Yes. Colour is set in CSS, and so is contrast. WCAG 2.2 asks for a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text (level AA). Light grey text on white fails. CSS can also hide focus outlines, which keyboard users need. See web accessibility and visual trust.

What are the common mistakes? #

  • Blocking CSS in robots.txt. Google may then see a broken page.
  • One huge style sheet for every page. Each page loads rules it never uses.
  • Facts in background images. Not indexed, not quotable.
  • Hiding text to rank. Off-screen or zero-size text breaks Google’s spam policies.
  • Images with no size. The page jumps as they load.
  • Long cache times with no new file name. Visitors and crawlers keep an old file after you change it. See edge cache and cache purge.
  • Low contrast. Hard to read for many people.
  • Different content on phones. Hiding a heading or price on mobile and showing another means Google indexes the mobile one. Keep the facts the same on every screen.

A worked example #

What we found Why it matters Fix
robots.txt blocks /assets/css/ Google cannot render the layout Allow the folder
300 KB style sheet in the head Slows the first paint Inline the top-of-page CSS, load the rest later
Price written inside a banner image No crawler can read it Put the price in text
Grey text at 2.8:1 contrast Fails WCAG AA Darken to 4.5:1 or more
Hero image with no width or height Layout shift Set the size or an aspect ratio

How to check it #

  1. Check that crawlers may fetch your CSS. The Robots.txt Checker tests any path, such as your CSS folder. The AI Bot Checker shows which AI crawlers are allowed in.
  2. Check how the CSS file is served. The HTTP Header Checker shows the status code, content type and cache headers of the .css address. See HTTP status code.
  3. Check redirects. A style sheet behind a redirect chain loads slower. The Redirect Checker shows every hop.
  4. Check the tags in the head. The Meta Tag Checker shows the viewport tag and other meta tags.
  5. Check links to files. The Broken Link Checker finds broken links on a page.
  6. Check what AI can read. The AI Readiness Checker scores whether the page’s content is ready to be read and quoted. The Schema Markup Checker confirms facts are also in structured data.
  7. See the page as Google renders it. URL Inspection in Google Search Console lets you test the live page and see whether your content appears on the page Google renders, as Google’s mobile-first guide advises.
  8. Compare with a rival. Compare Two Websites puts both pages side by side.
  9. Tidy and test the CSS itself. The CSS Beautifier makes a file readable. The Colour Contrast Checker tests text colours. The Colour Blindness Simulator shows how others see them.
  10. Check what non-rendering bots miss. The JavaScript SEO Checker shows what bots that do not run JavaScript cannot see. The Page Speed Checker and Core Web Vitals Checker are coming soon.
  11. Across the whole site: the Asset diet report lists scripts and styles each page type loads but never uses, and Real-user speed shows Core Web Vitals from your own visitors (in URSY Pro, opening in stages).

What URSY.com counts #

A request, in our counting, is one answer the website gave: a page, file, image, feed or API reply. So a bot that fetches your style sheets shows up as requests for those files, next to the pages it read. We count from the edge log as well as the origin, so files the cache answers are counted too. The rules are on our methodology page.

Questions #

Is CSS a programming language? #

It is a style sheet language. It describes how things look; it does not run logic like JavaScript. See JavaScript SEO.

Does Google read CSS? #

Google renders pages with Chromium, so it loads CSS it is allowed to fetch. It uses it to see the page as people do.

Is hiding text in tabs bad for SEO? #

No. Google’s spam policies say tabbed and accordion content is not abuse. Hiding text only to rank is.

Should I inline all my CSS? #

No. Inline only the small part needed for the top of the page. Load the rest as a file, which the browser can cache.

Sources #

Updated 24 November 2026 by URSY.com.

Cite this page: What is CSS?. URSY. Updated 26 November 2026. https://ursy.com/wiki/css/ · Section links

Tools for this

All 871 wiki entries, A to Z →