Close Menu

    Subscribe to Updates

    Get the latest creative news from FooBar about art, design and business.

    What's Hot

    Four Underrated Tire Brands That Can Compete With Michelin

    You Can Make Your Phone Look Transparent With An App

    Why In-Car Tech Can Sometimes Stop Working In Cold Weather

    Facebook X (Twitter) Instagram
    • Artificial Intelligence
    • Business Technology
    • Cryptocurrency
    • Gadgets
    • Gaming
    • Health
    • Software and Apps
    • Technology
    Facebook X (Twitter) Instagram Pinterest Vimeo
    Tech AI Verse
    • Home
    • Artificial Intelligence

      Read the extended transcript: President Donald Trump interviewed by ‘NBC Nightly News’ anchor Tom Llamas

      February 6, 2026

      Stocks and bitcoin sink as investors dump software company shares

      February 4, 2026

      AI, crypto and Trump super PACs stash millions to spend on the midterms

      February 2, 2026

      To avoid accusations of AI cheating, college students are turning to AI

      January 29, 2026

      ChatGPT can embrace authoritarian ideas after just one prompt, researchers say

      January 24, 2026
    • Business

      The HDD brand that brought you the 1.8-inch, 2.5-inch, and 3.5-inch hard drives is now back with a $19 pocket-sized personal cloud for your smartphones

      February 12, 2026

      New VoidLink malware framework targets Linux cloud servers

      January 14, 2026

      Nvidia Rubin’s rack-scale encryption signals a turning point for enterprise AI security

      January 13, 2026

      How KPMG is redefining the future of SAP consulting on a global scale

      January 10, 2026

      Top 10 cloud computing stories of 2025

      December 22, 2025
    • Crypto

      Binance Denies Sanctions Breach Claims After $1 Billion Iran-Linked USDT Transactions Reported

      February 16, 2026

      Ray Dalio Says the World Order Has Broken Down: What Does It Mean for Crypto?

      February 16, 2026

      Cardano Whales are Trying to Rescue ADA Price

      February 16, 2026

      MYX Finance Lost 70% In a Week: What Triggered the Sharp Sell-Off?

      February 16, 2026

      What Really Happened Between Binance and FTX? CZ Finally Tells His Side

      February 16, 2026
    • Technology

      Four Underrated Tire Brands That Can Compete With Michelin

      February 16, 2026

      You Can Make Your Phone Look Transparent With An App

      February 16, 2026

      Why In-Car Tech Can Sometimes Stop Working In Cold Weather

      February 16, 2026

      5 Car Repairs You Probably Shouldn’t Do On The Side Of The Road

      February 16, 2026

      Shell Owns All 6 Of These Popular Motor Oil Brands

      February 16, 2026
    • Others
      • Gadgets
      • Gaming
      • Health
      • Software and Apps
    Check BMI
    Tech AI Verse
    You are at:Home»Technology»The least amount of CSS for a decent looking site (2023)
    Technology

    The least amount of CSS for a decent looking site (2023)

    TechAiVerseBy TechAiVerseOctober 7, 2025No Comments4 Mins Read4 Views
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    The least amount of CSS for a decent looking site (2023)
    Share
    Facebook Twitter LinkedIn Pinterest WhatsApp Email

    The least amount of CSS for a decent looking site (2023)

    Summary: People often over-engineer solutions, and it leads to them running into problems with their CSS. In this article, we’ll take a look at the least amount of CSS that you need to make a decent looking page.

    The fun part of making a website is that if you write your HTML and nothing else, you have a responsive website.

    Granted, if you have images they can cause some overflow issues.

    So we can start things off by fixing that:

    img {
      max-width: 100%;
      display: block;
    }

    It’s possible you have videos or SVGs that are also causing problems (less likely with SVGs though), so if you need, you can expand upon this a little bit.

    img,
    svg,
    video {
      max-width: 100%;
      display: block;
    }

    Improving the typography

    The first thing we can do is change the font family since the default is never very exciting.

    We’ll just use a basic system-ui for this example. It has pretty good support these days, and looks good on every system without having to worry about loading in any extra fonts.

    In general, the font-size is a little small as well, so we can bump it up, and the default line-height is always a bit tight, so anything within the 1.5 to 1.7 range should do:

    body {
      font-family: System UI;
      font-size: 1.25rem;
      line-height: 1.5;
    }

    Though not perfect, this is already a huge improvement over the regular defaults.

    Adding Dark Mode Support

    Many people love dark mode, so let’s enable it based on a user’s system preferences.

    We can do this by using the color-scheme property:

    html {
      color-scheme: light dark;
    }

    This will set the user-agent-styles to either a light or dark theme, based on the users system preferences.

    If you’d prefer, we can do this without CSS as well!

    <html lang="en" color-scheme="light dark">html>

    A small note on following the system preferences

    While this is really handy, it is a best practice to allow users to manually toggle the color-scheme as well.

    Some people prefer a dark system theme, but light website themes, and vice-versa.

    Restraining Content Width

    Line-length is one of the most important things when it comes to the readability of text.

    We generally want to try and fall somewhere in the 45-90 characters per line range (for body text, not headlines).

    To make the website more readable, we’ll limit the content width using a main element and some CSS magic:

    main {
      max-width: min(70ch, 100% - 4rem);
      margin-inline: auto;
    }

    The min() function here will pick whatever is smallest, either 70ch or 100% - 4rem. Because we are inside a min() function, we don’t need to use a calc().

    Whatever the output from that min() function, the width is less than 100%, so the page will be stuck to the left side of the viewport.

    We can then use margin-inline: auto to center it, as this acts on the margins on the inline axis, so in any horizontal writing modes, that means both the margin-left and margin-right are auto.

    You might want to switch out the main selector for a .container or .wrapper so you can have more control over where you use it.

    And with that, our final CSS file looks like this:

    html {
      color-scheme: light dark;
    }
    
    body {
      font-family: system-ui;
      font-size: 1.25rem;
      line-height: 1.5;
    }
    
    img,
    svg,
    video {
      max-width: 100%;
      display: block;
    }
    
    main {
      max-width: min(70ch, 100% - 4rem);
      margin-inline: auto;
    }

    Build on top of this

    This is just a quick start to get things off the ground, though it could be used for a very simple page as well.

    For the most part, though, you’ll probably want to build on top of this, but it should be able to act as a nice jumping off point!

    Share. Facebook Twitter Pinterest LinkedIn Reddit WhatsApp Telegram Email
    Previous ArticleTaylor Swift Launches a New Instagram Feature Inviting Fans to Remix Others’ Stories
    Next Article Pdoc – Generate API documentation for Python projects
    TechAiVerse
    • Website

    Jonathan is a tech enthusiast and the mind behind Tech AI Verse. With a passion for artificial intelligence, consumer tech, and emerging innovations, he deliver clear, insightful content to keep readers informed. From cutting-edge gadgets to AI advancements and cryptocurrency trends, Jonathan breaks down complex topics to make technology accessible to all.

    Related Posts

    Four Underrated Tire Brands That Can Compete With Michelin

    February 16, 2026

    You Can Make Your Phone Look Transparent With An App

    February 16, 2026

    Why In-Car Tech Can Sometimes Stop Working In Cold Weather

    February 16, 2026
    Leave A Reply Cancel Reply

    Top Posts

    Ping, You’ve Got Whale: AI detection system alerts ships of whales in their path

    April 22, 2025678 Views

    Lumo vs. Duck AI: Which AI is Better for Your Privacy?

    July 31, 2025260 Views

    6.7 Cummins Lifter Failure: What Years Are Affected (And Possible Fixes)

    April 14, 2025154 Views

    6 Best MagSafe Phone Grips (2025), Tested and Reviewed

    April 6, 2025112 Views
    Don't Miss
    Technology February 16, 2026

    Four Underrated Tire Brands That Can Compete With Michelin

    Four Underrated Tire Brands That Can Compete With Michelin Best Auto Photo/Shutterstock We may receive…

    You Can Make Your Phone Look Transparent With An App

    Why In-Car Tech Can Sometimes Stop Working In Cold Weather

    5 Car Repairs You Probably Shouldn’t Do On The Side Of The Road

    Stay In Touch
    • Facebook
    • Twitter
    • Pinterest
    • Instagram
    • YouTube
    • Vimeo

    Subscribe to Updates

    Get the latest creative news from SmartMag about art & design.

    About Us
    About Us

    Welcome to Tech AI Verse, your go-to destination for everything technology! We bring you the latest news, trends, and insights from the ever-evolving world of tech. Our coverage spans across global technology industry updates, artificial intelligence advancements, machine learning ethics, and automation innovations. Stay connected with us as we explore the limitless possibilities of technology!

    Facebook X (Twitter) Pinterest YouTube WhatsApp
    Our Picks

    Four Underrated Tire Brands That Can Compete With Michelin

    February 16, 20262 Views

    You Can Make Your Phone Look Transparent With An App

    February 16, 20262 Views

    Why In-Car Tech Can Sometimes Stop Working In Cold Weather

    February 16, 20262 Views
    Most Popular

    7 Best Kids Bikes (2025): Mountain, Balance, Pedal, Coaster

    March 13, 20250 Views

    VTOMAN FlashSpeed 1500: Plenty Of Power For All Your Gear

    March 13, 20250 Views

    This new Roomba finally solves the big problem I have with robot vacuums

    March 13, 20250 Views
    © 2026 TechAiVerse. Designed by Divya Tech.
    • Home
    • About Us
    • Contact Us
    • Privacy Policy
    • Terms & Conditions

    Type above and press Enter to search. Press Esc to cancel.