Core Structure and Logic

The Visual Language of the Web: Introduction to CSS Core Topics

CSS (Cascading Style Sheets) is not just the makeup of the web; it is its mathematical architecture.
Where HTML deals with "what it is" (structure), CSS deals with "how it looks" (presentation).
In this section, we will introduce the core topics of CSS.

Main Topic Philosophical and Historical Context

CSS Syntax Structure Detailed Diagram Visualization

CSS Syntax Structure
Selector
h1
property
:
value
;
color
:
blue
;
font-size
:
16px
;
Selector: Defines the HTML element to be styled (such as h1, .class, #id).
Declaration Block: Contains one or more declarations inside curly braces { }.
Property: The name of the style attribute to be changed (such as color, font-size, margin).
Value: The value assigned to the property (such as blue, 16px, 20px).
Declaration: The combination of a Property and a Value (property: value;).
Rule: The combination of the Selector and the Declaration Block. It forms a complete CSS rule.
Level 5

Introduction to the CSS Language Visual Architect of the Web and Style Management

CSS: Visual Architect of the Web and Style Management

When you visit a website in the modern digital world, the colors, spacing, animations, and page layout you encounter are the work of a powerful style language running in the background: CSS.

In today's technology, the equivalent of this structure—whose historical development and philosophical origins we examine—is not just

"coloring text," but building a complete User Experience ( UX ) Design.

Before diving into technical details and coding, understanding this massive role CSS plays and its organic link with HTML conceptually is critically important to establish the logic behind the code we will write.

The Dance of Structure and Presentation: The HTML and CSS Relationship

If we compare a web page to the human body, HTML forms the bones, organs, and skeletal system of this body.

HTML determines where each bone stays, where the arm begins, and where it ends.

However, while a skeleton is functional on its own, it is not a visually complete structure; this is exactly where CSS comes into play.

CSS is the skin, eye color, clothing, and even the muscle memory that determines how that body will move.

While HTML tells the browser "There is a button here," CSS tells the browser "That button should have rounded corners," or

"That button's color should transition from blue to green and have a shadow."

Although these two languages have completely different rules, modern web browsers combine them in milliseconds ( rendering them ) to present us with a unified page.

Thanks to this cooperation, the entire atmosphere of a site can be transformed from a "serious corporate site" to a

"fun blog" by simply changing the style file, without breaking the content.

From Static Document to Interactive Experience

The power of CSS is not limited only to static visual properties.

While pages in the early years of the web were static like magazines printed on paper, modern CSS capabilities now allow for the design of living, responsive interfaces.

CSS manages the opening speed of a menu, the scrolling effect of an image gallery, or how content is reordered based on screen size using mathematical calculations.

Especially with the rise of mobile device usage, CSS has become the main engine of "Responsive Design."

The technology that allows the same website to be displayed with a wide three-column layout on a 27-inch monitor, while appearing on a 6-inch phone screen with a single column and touch-friendly buttons, is based entirely on CSS rules.

This flexibility ensures that content remains readable and accessible under all conditions.

The Cascading Management Approach

The most fundamental feature that distinguishes CSS from other technologies lies in the management logic hidden in the word "Cascading."

Style rules in a web project may not come from a single source; the browser's own defaults, user preferences, and the code written by the developer are processed together.

CSS filters thousands of style commands coming from these different sources according to a specific hierarchy and priority order.

Thanks to this logic, a general rule ( "Let all text be black" ) can be written at the top, while a specific exception

("Let only warning messages be red") can be defined further down the cascade.

This "general to specific" flow logic allows even massive web projects consisting of thousands of pages to be managed from a single center without causing confusion.

All of the technical applications we will see in the following sections are built upon this hierarchical logic.

The Browser Rendering Process:

When a browser loads a web page, it first reads the HTML file to build the DOM (Document Object Model) tree.

Then, it analyzes the CSS rules to produce the style tree called CSSOM (CSS Object Model).

These two structures are merged to form the Render Tree, and the browser uses this tree to decide how to draw the page at the pixel level.

CSS Rule Structure:

CSS rules basically consist of two parts: a selector and style declarations.

The selector determines which HTML element the style will be applied to.

The declaration part consists of property and value pairs enclosed in curly braces.

External CSS Stylesheets The Professional Management Center

Overview

The most widely accepted, efficient, and sustainable method in the modern web development world is the use of External Stylesheets.

This method is based on the principle of completely extracting CSS code from the HTML document and housing it in an entirely independent file with a .css extension.

In this structure, the communication between the HTML file and the style file is established through the <link> tag added to the <head> section of the HTML.

The Message Given to the Browser: Before building the skeleton of this page, go and fetch the style rules from the following address.

The reason why external stylesheets are the "Gold Standard" is the logic of "Write once, apply everywhere"; the detailed reasons are listed below.

Centralized Management and Scalability:

The greatest superpower of this method is the "Write once, apply everywhere" logic. A single style.css file can be linked to hundreds, or even thousands, of different HTML pages across your site.

For example: When you want to change your site's main color from blue to red, you don't need to open and edit thousands of pages individually.

When you change a single line of code in the external file, all pages linked to that file are updated within seconds and in real-time.

This is the fundamental factor that makes large-scale projects manageable.

Complete Isolation of Structure and Presentation:

CSS's founding philosophy, the "Separation of Concerns," is applied here in its purest form.

Your HTML file stays clean by focusing only on content ( headings, paragraphs, images ), while style code lives in its own dedicated file.

This clear separation improves code readability and allows designers and developers to work on the same project without interfering with each other's code.

Performance and Caching:

External stylesheets utilize a technology that directly boosts site speed.

When a user enters your site for the first time, the browser downloads this external .css file and saves it to the device's memory ( cache ).

When the user moves to a second, third, or hundredth page on your site, the browser uses the copy in its memory instead of downloading the file again.

This reduces data traffic and noticeably speeds up page load times while navigating between pages.

</>
CSS External Stylesheet Example (+)
<!DOCTYPE html>
  <html lang="en">
  <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Simple Style Example</title>

      <!-- External CSS file -->
      <link rel="stylesheet" href="style.css?v=1.0.150">
  </head>
  <body>

      <h1>Welcome</h1>
      <p>
          This page is styled using an external CSS file.
          The default font, background color, and text color are applied via CSS.
      </p>

  </body>
  </html>
body {
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
    color: #333;
  }

  h1 {
    color: #0056b3;
    text-align: center;
  }

  p {
    line-height: 1.6;
  }

Internal CSS Stylesheets Page-Based and Isolated Management

Overview

Unlike external files, the method where style codes "do not leave the house" and reside directly within the HTML document is called Internal CSS.

In this method, CSS rules are written between the <style> tags opened in the <head> section of the HTML page.

Thus, the browser loads the styles simultaneously while reading the page, without sending a request to another server or file.

This method is used as a strategic "intermediate solution" in web development processes and possesses a specific balance of advantages and disadvantages:

Rapid Prototyping and Testing:

While a developer is working on a new design idea or writing experimental code, constantly switching between the style.css file and the HTML file can be time-consuming.

Internal CSS ensures that the code is right at your fingertips.

Once the idea is verified and approved, these codes are usually moved to an external file.

Single-Page Special Projects: If your project is a single "Campaign Page" or a simple "Error Report Page" with a design completely independent from the rest of the site, creating an external file for this page might create an unnecessary HTTP request.

In these "one-off" situations, it is more practical to keep the styles within the page.

Independence: The file reaches a self-contained structure, meaning it is self-sufficient without needing any external resources.

This is a preferred choice, especially in email newsletter designs or portable standalone documents.

Critical Disadvantage: The Sustainability Issue

The greatest enemy of using Internal CSS is "Scalability."

The fundamental principle of web development, "Don't Repeat Yourself" ( DRY ), is violated in this method.

Management Chaos: Imagine you have a 50-page website; if you want to change the menu color from "Blue" to "Black" while using Internal CSS, you would have to open each of the 50 different HTML files one by one to find and change that code.

This is a time-consuming process that increases the risk of making mistakes.

Lack of Caching: While external CSS files are downloaded once by the browser and kept in memory, Internal CSS is read repeatedly along with the HTML every time the page is refreshed.

On large sites, this can lead to a waste of bandwidth.

</>
CSS Internal Stylesheet Example ( )
<!DOCTYPE html>
<html lang="tr">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Page Title</title>
  <style>
      body {
          font-family: Verdana, sans-serif;
          background-color: #e0f2f7;
          color: #2c3e50;
      }

      h1 {
          color: #e74c3c;
          text-align: left;
      }
  </style>
</head>
<body>
</body>
</html>

CSS Inline Styles Direct Intervention and Absolute Authority

General Description

Inline CSS, the final step in the CSS hierarchy, is the injection of style rules directly into the target HTML tag using the style="..." attribute, rather than in an external file or at the top of the page.

This method disables CSS's "remote management" capability and locks the style and the element together.

This usage is like a double-edged sword in the web development world:

Mechanical Advantage: Absolute Specificity

The most defining feature of inline styles is their indisputable authority in the eyes of the browser.

In CSS's "Cascading" logic, the physically closer a style rule is to the element, the more dominant it becomes.

Even if a button's color is defined as "Blue" in your external file and "Green" at the top of the page; if the button's own tag contains:

<button style="color: red;"> that button will be Red.

The browser ignores all rules in external files and applies the inline command.

This feature plays a vital role in instantaneous visual changes usually performed with JavaScript ( such as changing the width of a loading bar within milliseconds ).

Architectural Disadvantage: Structural Pollution and Management Nightmare

Inline styles fundamentally violate the most sacred rule of modern web standards: the principle of "Separation of Content (HTML) and Presentation (CSS)."

Loss of Code Readability: Long style codes squeezed between HTML tags make it difficult to see the page's skeleton.

Instead of a clean structure, it creates a complex pile of intertwined code ( Spaghetti Code ).

Impossibility of Maintenance: Imagine you have given color to 100 different buttons on your site via inline styles.

If you want to change this color in the future, instead of editing a single file, you would have to find and fix 100 different HTML lines one by one.

This is an unacceptable situation for a sustainable project.

Repetition and Performance Loss: The code must be written over and over again for every element that uses the same style.

This unnecessarily inflates the file size and prevents the browser from using its caching advantage.

</>
CSS Inline Styles Example ( )
<!DOCTYPE html>
<html lang="tr">
<head>
    <meta charset="UTF-8">
    <title>Inline CSS Example</title>
</head>
<body>

    <p style="color: blue; font-size: 16px; border: 1px solid red; padding: 10px;">
        This paragraph text is blue, has a font size of 16 pixels, and has a red border.
    </p>

    <p>
        This paragraph appears with the default browser style.
    </p>

</body>
</html>

Development Environment Where is Code Written?

Introduction - General Overview

After learning the working logic of CSS and its position within a project, we need to get to know our digital workbench—the "Editors"—required to start the coding process.

By its nature, CSS is a pure text-based language that does not need to be compiled.

Technical Meaning: You can open the simplest text editor installed on your computer, which may vary by operating system.

( Notepad for Windows, TextEdit for Mac ), write your code, and run it by saving the file with a .css extension.

You are not "forced" to use high-cost or complex software to write CSS.

However, standard notepads are not used in the professional web development world.

Because these simple tools see your code only as "plain text"; they don't tell you where you made a mistake, won't color the code, or give you hints.

Therefore, developers use a tool called an IDE ( Integrated Development Environment ) or advanced Code Editors that speed up the coding process, catch errors as you write, and make reading easier. Below, we take a look at the most powerful pens of the modern web world.

Visual Studio Code (VS Code)

Developed by Microsoft, it is a free and open-source editor that has become the de facto standard of the web development world today.

The greatest strength that sets VS Code apart from others is IntelliSense technology.

When you have just typed "back," it predicts that you want to type "background-color" and completes the code for you.

Why Choose It? Thanks to its rich extension marketplace, you can customize the editor to your personal needs.

You can auto-format your code with extensions like "Prettier" and see the code you wrote instantly in the browser with "Live Server."

You can also manage version control directly from within the editor with its built-in Git support.

Sublime Text

A symbol of speed and performance, Sublime Text is famous for consuming the least amount of computer resources ( RAM, CPU).

It doesn't come with as many loaded features as VS Code, but it opens at lightning speed and works without lagging even with massive files.

Why Choose It? With the "Multi-Cursor" feature, you can edit ten different lines at the same time, and with "Snippet" support, you can call up frequently used code blocks with a single key.

It is a favorite among developers who want to stay minimalist, simple, and focused solely on the code.

Atom (and Its Historical Significance)

Developed by GitHub with the slogan "A hackable text editor for the 21st century," Atom is an important representative of the open-source philosophy.

With its modern interface and modular structure, it was a favorite among developers for a long time.

Why Was It Important? Atom is the pioneer of the "Electron" framework, which VS Code also uses today.

It is one of the first popular tools to embed Git and GitHub integration directly into the editor.

It turned coding into a visual pleasure with its user-friendly interface and thousands of community-developed themes.

Current Status: Project Discontinued (2022) Caution:

Atom is considered a legend that has completed its mission.

GitHub officially discontinued the Atom project on December 15, 2022, to focus its efforts on VS Code.

It has been moved to ( Sunset ) and "Archive" mode.

It no longer receives security updates or new features.

Therefore, while its historical significance is great, it is not recommended for new projects.

It has passed its legacy and technology on to modern editors.

WebStorm (JetBrains)

Developed by JetBrains, it is a powerful IDE designed specifically for professional web development.

Unlike VS Code, it is paid software, but it offers free licenses for students and open-source projects.

Why Choose It? It offers professional features such as advanced code analysis, automatic refactoring, and an integrated debugger.

Especially in large-scale projects and team collaborations, it provides tools that increase code quality and efficiency.

It includes specific support and templates for modern frameworks like TypeScript, React, Vue, and Angular.

Brackets (Adobe)

Developed by Adobe, it is a free and open-source editor designed specifically for web designers.

Its most important feature is "Live Preview" technology; you can see the CSS code you write instantly in the browser.

Why Choose It? Through integration with Adobe tools like Photoshop and Illustrator, it eases the transition for designers into the coding process.

It has a lightweight and user-friendly interface optimized specifically for front-end designers and CSS-focused developers.

With the "Extract" feature, you can convert color codes and measurements directly from Photoshop files into CSS code.

Level 4

CSS1 Version The Web's First Style Constitution (1996)

Introduction - General Overview

After the idea of CSS was proposed by Håkon Wium Lie in 1994, the meticulous work carried out alongside Bert Bos bore fruit, and

in December 1996, "CSS Level 1" was published as an official W3C recommendation.

This version was a "turning point" for the web world.

Because CSS1 wrote the first rulebook for transforming web pages from simple academic documents into design products with a visual identity.

The features introduced by CSS1 may seem very basic to us today, but at the time, they were a declaration of freedom for designers trapped within HTML.

The Typography Revolution

The greatest achievement of CSS1 was ending the chaos created by the <font> tag.

With this version, developers completely separated typographic controls—such as font family ( font-family ), font size ( font-size ), color ( color ), and alignment ( text-align )—from HTML.

Text was no longer just a pile of data to be read, but designable visual elements.

Adjusting the line height ( line-height ) of text or managing the spacing between words was the first step toward bringing web typography closer to print publishing standards.

This fundamentally changed the readability and aesthetics of the web.

The Box Model: The Physics of the Web

When the legacy of CSS1 is mentioned, the most critical concept is indisputably the Box Model.

CSS1 defined that every single element ( a letter, an image, or a heading ) on a web page lives within an invisible rectangular box.

Thanks to this model, developers were able to mathematically control an element's relationship with its surroundings for the first time:

Margin (External Spacing): The distance between the box and other boxes.

This area is completely transparent and defines an element's "personal space."

By pushing neighboring elements, it allows the page to breathe and prevents elements from appearing stuck together or cramped.

The distance between the box and other boxes.

Padding (Internal Spacing): The "breathing" room between the box's content ( like text ) and its border.

This buffer zone protects and expands the content.

Without padding, text sticks to the edges and becomes difficult to read; this spacing adds a sense of freshness and a professional touch to the design.

Border: The line that draws the boundaries of the box, standing between Margin ( outside ) and Padding ( inside ).

This line visually marks where the element ends.

If desired, thick, colored, or dashed lines can be used to add a stylistic frame to the design; it makes the invisible box visible.

Visual Enrichment: Color and Background

The standard of "black text on a gray background" that the web had until then was demolished by CSS1.

The background-color and background-image properties added texture and atmosphere to pages.

It became possible to assign a color behind an element or the entire page, or even to tile an image as a background.

This feature paved the way for brands to reflect their corporate colors and identities on their websites.

Foundations of Lists and Navigation

The web's most important functions—the "linking" ( hyperlink ) and "listing" structures—were also stylized with CSS1.

At that time, menus on websites were essentially lists ( <ul>, <li> ) ordered vertically.

By offering the ability to remove or change the black dots ( bullet points ) at the beginning of these lists, CSS1 created the ancestor of what we know today as

"Navigation Menus."

Furthermore, interactions such as removing the underline from links ( text-decoration: none ) or changing their color upon hovering were the first seeds of user experience.

First Layout Attempts: Float Modern layout systems did not yet exist during the CSS1 era. Developers mostly used the float property to create page arrangements.

This feature was actually designed to allow images to flow within text; however, developers began using it to create columned page layouts.

For years, many websites were built with complex float-based layout techniques. This approach remained the primary method of web design until the emergence of modern systems like Flexbox and CSS Grid.

</>
CSS1 Features Example (+)
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS1 Example - Basic Styles</title>
    <link rel="stylesheet" href="style.css?v=1.0.150">
</head>

<body>
    <h1>CSS1 Basic Features</h1>

    <div class="kutu">
        <h2>Text Formatting</h2>
        <p>This is a paragraph example. With CSS1, we can control text styles.</p>
        <p>Basic properties such as font, color, size, and alignment are demonstrated here.</p>
    </div>

    <div class="kutu">
        <h2>Links</h2>
        <p>
            <a href="#">This is a normal link</a> -
            <a href="#">This is another link</a>
        </p>
        <p>Links appear in blue and are underlined.</p>
    </div>

    <div class="kutu">
        <h2>Lists</h2>
        <p>Unordered list example:</p>
        <ul>
            <li>First item</li>
            <li>Second item</li>
            <li>Third item</li>
            <li>Fourth item</li>
        </ul>
    </div>

    <div class="kutu">
        <h2>Box Model</h2>
        <p>These boxes demonstrate margin, padding, and border properties.</p>
        <p>Each element is considered as a box, and the inner/outer spacing of these boxes can be adjusted.</p>
    </div>

    <div class="kutu">
        <h2>Color and Background</h2>
        <p>The background is white, and the text is black.</p>
        <p>Headings use a navy color.</p>
    </div>

    <p style="text-align: center; margin-top: 30px;">
        <a href="#">Home</a> |
        <a href="#">About Us</a> |
        <a href="#">Contact</a>
    </p>
</body>

</html>
body {
      font-family: Arial, sans-serif;
    background-color: #ffffff;
    color: #000000;
    margin: 0;
    padding: 20px;
}

h1 {
    font-size: 24px;
    text-align: center;
    color: navy;
    margin-bottom: 20px;
}

h2 {
    font-size: 20px;
    color: darkblue;
    margin-top: 30px;
}

p {
    margin: 10px;
    padding: 5px;
    line-height: 1.5;
}

a {
    color: blue;
    text-decoration: underline;
}

a:hover {
    color: darkblue;
}

ul {
    list-style-type: disc;
    margin-left: 20px;
}

li {
    margin-bottom: 8px;
}

.kutu {
    border: 1px solid #ccc;
    padding: 15px;
    margin: 10px 0;
    background-color: #f9f9f9;
}

First Browsers to Support CSS1

IE 3.0 (1996)
Netscape 4.0 (1997)
Opera 3.5 (1998)
Level 4

CSS2 Version The Revolution of Layout and Depth Perception (1998)

Overview

Published by the W3C in 1998, CSS2 is a historic turning point that transformed web design from mere "colored text" into a

"true art of layout."

With CSS1, we could manage text and colors, but placing boxes exactly where we wanted on a page ( such as creating a sidebar ) was still a major struggle, and designers were forced to use clunky HTML tables for this task.

CSS2 brought the features that ended this captivity.

By introducing Position ( X-Y axis ) and Depth ( Z axis ) to web pages, it opened the doors to modern interface design.

Positioning: Coordinate Freedom

The greatest gift of CSS2 is the ability to move elements freely around the page.

Previously, elements could only be ordered sequentially, but with the Positioning Module, the web page transformed into a coordinate plane.

Relative: It provided the ability to shift an element right/left or up/down from its normal position.

Critical Point: Even if the element moves visually, the space it originally occupied is preserved; meaning other elements do not shift upward as if it were gone.

It is often used as a strategic container to establish a "boundary" or "reference point" for elements to be positioned absolutely within it.

Absolute: It allowed for giving precise commands like "Stick to the top-right corner of the page" by completely removing the element from the page flow.

An element marked with Absolute is now "non-existent" to other elements; it can overlap them or pass underneath without disturbing the page layout.

This feature grants the designer the freedom to perform millimetric (pixel-perfect) placement, much like on paper.

Fixed: It laid the foundation for modern interfaces that stay suspended on the screen even when the page is scrolled down ( such as sticky menus or "Back to Top" buttons ).

Its logic is similar to Absolute, but the reference point is the user's browser window rather than the page itself.

No matter how long the content gets, a Fixed element always stays in view, like a label stuck to the glass of the screen.

Z-index: The Arrival of the Third Dimension to the Web

Before CSS2, web pages were entirely 2D; no element could overlap another.

CSS2 introduced the concept of "Depth" to the web with the z-index property.

Thanks to this feature, designers could stack cards, show dropdown menus over content, or place a "Pop-up" window at the very top of the page.

The answer to the question "Which element is in front, and which is behind?" became controllable via a mathematical numerical value

( z-index score ).

Media Types: A Multi-Platform Vision

This was the first visionary step anticipating that the web could be consumed not only on computer screens but also in different environments.

With the @media rule, CSS2 offered the ability to say: "If this page is being printed, hide the menus and make the font black."

Although this feature later evolved into "Responsive Design" with CSS3, it was the first seed of optimizing content presentation according to the environment.

Generated Content: Clean HTML

By introducing the ::before and ::after pseudo-elements, CSS2 paved the way for adding visual elements to a page without cluttering the HTML code.

Developers became able to add icons before a heading, quotation marks at the end of a quote, or special shapes next to a list without writing extra HTML tags.

This was the most elegant application of the "Don't write HTML for design, use CSS" philosophy.

Aural Style Sheets CSS2 introduced the concept of "Aural Style Sheets," emphasizing that the web is for everyone, not just for those who can see.

These features aimed to determine the tone, speed, or emphasis with which screen readers would read text. Although they couldn't become widespread at the time due to technical limitations, they formed the spiritual foundation of today's modern "Web Accessibility" standards.

Display Behavior

With CSS2, the display property became one of the fundamental ways to control an HTML element's behavior on the page.

Determining whether an element behaves as a block or inline was now under the developer's control.

For example, display: block transforms an element into a box that occupies the entire row, while display: inline makes the element behave within the text flow.

Through this system, developers could design more flexible interfaces by changing the default behaviors of HTML elements.

Overflow Control

With CSS2, developers gained the ability to determine how a box should behave when its content exceeds its boundaries.

Thanks to the overflow property, overflowing content could be hidden, made scrollable, or managed automatically.

For example, overflow: hidden makes overflowing content invisible, while overflow: scroll provides the user with a scrollbar.

</>
CSS2 Features Example (+)
<!DOCTYPE html>
<html lang="tr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS2 Simple Example</title>
    <link rel="stylesheet" href="style.css?v=1.0.150">
</head>

<body>
    <!-- FIXED HEADER -->
    <div class="ust-bolum">
        <h1>CSS2 Features</h1>
    </div>

    <!-- MAIN CONTENT -->
    <div class="icerik">
        <div class="kutu">
            <h2 class="ozel-baslik">CSS2 Innovations</h2>
            <p>CSS2 introduced major improvements to web design.</p>
        </div>

        <div class="kutu">
            <h3 class="ozel-baslik">Positioning Features</h3>
            <div class="konumlu-liste">
                <ul>
                    <li class="liste-maddesi">position: fixed - Fixed position</li>
                    <li class="liste-maddesi">position: absolute - Absolute position</li>
                    <li class="liste-maddesi">position: relative - Relative position</li>
                    <li class="liste-maddesi">z-index - Layer order</li>
                </ul>
            </div>
        </div>

        <div class="kutu">
            <h3 class="ozel-baslik">Pseudo-elements</h3>
            <ul>
                <li class="liste-maddesi">::before - Add content before</li>
                <li class="liste-maddesi">::after - Add content after</li>
                <li class="liste-maddesi">content property</li>
            </ul>
        </div>

        <div class="kutu">
            <h3 class="ozel-baslik">Media Queries</h3>
            <ul>
                <li class="liste-maddesi">@media print - Print styles</li>
                <li class="liste-maddesi">@media screen - Screen styles</li>
                <li class="liste-maddesi">Adaptation for different devices</li>
            </ul>
            <p><strong>Note:</strong> Try printing the page. The top menu will be hidden.</p>
        </div>

        <div class="kutu">
            <h3 class="ozel-baslik">Other Features</h3>
            <ul>
                <li class="liste-maddesi">Advanced selectors</li>
                <li class="liste-maddesi">Aural style sheets</li>
                <li class="liste-maddesi">Table styles</li>
                <li class="liste-maddesi">Content generation</li>
            </ul>
        </div>
    </div>
</body>

  </html>

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: #f5f5f5;
}

.ust-bolum {
    position: fixed;
    top: 0;
    width: 100%;
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: center;
    z-index: 100;
}

.icerik {
    margin-top: 80px;
    padding: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.ozel-baslik::before {
    content: "🔹 ";
    color: #e74c3c;
}

.liste-maddesi::before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
}

.konumlu-liste {
    position: relative;
    left: 20px;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

@media print {
    .ust-bolum {
        display: none;
    }

    .icerik {
        margin-top: 0;
    }
}

.kutu {
    background: white;
    padding: 20px;
    margin: 15px 0;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

ul {
    margin: 10px 0;
}

li {
    margin: 8px 0;
    padding-left: 5px;
}

First Browsers to Support CSS2

IE 5.0+ (1999)
Netscape 6.0+ (2000)
Opera 4.0+ (2000)
Level 4

CSS3 Version Architecture of the Modern Web and Mobile Era

Overview

With the 2010s, the web world experienced its greatest turning point: Smartphones ( iPhone and Android ) entered our lives.

Websites now had to function not just on desktop computers, but on screens as small as the palm of a hand.

CSS3 emerged in the midst of this "Mobile Revolution" like a superhero coming to the rescue of developers.

Unlike previous versions, CSS3 arrived with a modular structure, transforming the web from a static document into a dynamic platform delivering app-like experiences.

Visual Effects: Farewell to Photoshop

Before CSS3, to create a box with rounded corners or a shadowed button, designers had to cut images in Photoshop and embed them into the code.

This was both tedious and slowed down the site, so a new solution was required.

Rescue Features: Features that add visual richness such as border-radius ( rounded corners ), box-shadow ( box shadow ), and

linear-gradient ( color transitions ).

These features softened the "angular and harsh" digital look that the web had until then.

Border Radius: While it previously required combining four different corner images to make a simple round button, any kind of geometric softness can now be achieved with a single line of code.

Box Shadow: It brought the physics of "light and shadow" to design; creating a hierarchy by making elements appear as if they are floating on the screen.

Gradients: Instead of downloading heavy image files for backgrounds, it allows the browser to blend colors together mathematically.

Philosophy:

"Don't use images, use code." Thanks to CSS3, browsers became capable of drawing these visuals themselves within seconds.

This dramatically increased page load speeds and gave designers unlimited freedom.

This shift marks the beginning of the "Sustainable Design" approach.

Previously, to change a site's theme from blue to red, hundreds of graphic files had to be individually opened in Photoshop, their colors changed, and then saved again.

With CSS3, this process became as simple as changing a color code within the code.

Consequently, design processes dropped from weeks to minutes, and the web gained a much more flexible structure.

Motion and Vitality: Transforms and Animations

In the past, to see something moving on websites, the heavy and security-prone "Flash" plugin was required.

CSS3 made animation a natural part of the web.

Transform: Allows for instantaneous visual transformations such as rotating, skewing, scaling or changing position in 2D or 3D space.

Thanks to this feature, web pages were freed from boring vertical and horizontal lines.

A card lifting slightly upward when hovered over, or a menu opening like a 3D door, creates the feeling that the user is having a physical interaction with the site.

Moreover, since these operations are performed on the graphics processor ( GPU ), they yield very smooth results without taxing the computer.

Transition: It enriches the user experience by ensuring that a style change occurs smoothly over a specific duration rather than instantaneously.

This is the foundation of "Micro-interactions" in modern interface design.

It gently conveys the message "Look, something just changed" to the user without straining the eyes.

It is like slowly turning on a light with a dimmer switch instead of flicking it on with a "click"; it adds an organic and professional feel to the interface.

Animation: It made it possible to create and loop complex, multi-step animations defined with the @keyframes rule ( such as motion graphics, scrolling text )

without needing JavaScript.

This means being able to write a scene-by-scene script like a film director.

You can plan frame-by-frame what happens at 0%, where it goes at 50%, and how it ends at 100%.

This feature was the final blow that ended the dominance of the legendary Flash technology on the web and started the modern, high-performance motion web.

Modern Layout Systems: Flexbox and Grid

Building a "layout" was the greatest nightmare of web design for years.

Page layouts were attempted using tools like float, which were actually created for wrapping text around images.

CSS3 introduced two revolutionary engines specifically produced for this task:

Flexbox (1-Dimensional Intelligence):

A "master of arrangement" designed for one-dimensional ( only row or only column ) alignments; it solves the question: "How should I distribute the space?"

It automatically centers items in a menu, shifts others if one is deleted, and equalizes the distance between them.

It has particularly rendered navigation bar and vertical centering issues a thing of the past.

Grid (2-Dimensional Architecture):

A two-dimensional "structural engineer" that treats the web page like a mathematical notebook consisting of rows and columns.

It is used to establish the general skeleton of the page ( Header, Sidebar, Content, Footer ).

Unlike Flexbox, it can control items both horizontally and vertically at the same time.

Coding complex, magazine-style layouts has become child's play with Grid.

Responsive Design: One Code, Every Device

Perhaps the most vital innovation of CSS3 is @media queries.

Philosophically, this technology brought the logic "Content is like water; it takes the shape of its container" to the web.

Developers could now give the browser the following command:

"If the screen width is less than 768 pixels ( tablet/mobile ), hide the sidebar and enlarge the text."

Thanks to this, instead of making separate websites for desktop, tablet, and phone; intelligent designs that adapt to every screen with a single codebase became the standard.

CSS3 Advanced Features Variables, Calculations, and Advanced Visual Controls

Overview

Modern CSS is no longer just a language for color and positioning; it has evolved into a system that is dynamic, capable of of calculation and provides behavioral control.

Thanks to advanced features introduced with CSS3, developers can now perform many visual and mathematical operations directly within the style layer without the need for JavaScript.

These features reduce code repetition, empower responsive design, and make the user experience much more fluid.

Variables / Custom Properties

CSS variables (Custom Properties) allow for defining repeating values at a central point and reusing them wherever needed.

For example: The primary color, font size, or spacing values used in a project are defined with variables like --primary-color and called via the var() function.

This approach provides single-point control, especially in large projects; changing a single value instantly updates the entire design.

Furthermore, variables play a critical role not only for static values but also for dynamic structures like theme systems.

Calc() / Clamp(), min(), max()

CSS can now work not only with fixed values but also with mathematical calculations.

The calc() function enables the creation of dynamic measurements by combining different units ( %, px, vw ).

This allows for expressions such as: "Subtract 100px from 100% of the screen" to be defined directly within CSS.

clamp(), min(), and max() are the most powerful tools for responsive design.

Through these functions, minimum and maximum boundaries for a value can be determined.

This ensures the design is both flexible and stays within control.

Filters / Backdrop-filter

With CSS3, visual effects are no longer dependent solely on graphic tools; they have become applicable directly through code.

Effects such as blur, brightness, contrast, and grayscale can be applied with the filter property.

The backdrop-filter affects the area behind the element, creating glass effects frequently used in modern UI designs.

These features make the user interface more deep and aesthetic.

Multi-column Layout

The CSS Multi-column system allows content to be automatically divided into multiple columns.

Through properties like column-count and column-gap, long texts are made more readable.

This structure is ideal, especially for blog posts, articles, and news sites.

However, with the advent of modern layout systems (Flexbox, Grid), its usage has been reduced to more niche scenarios.

Scroll Snap / Scroll-behavior

Scrolling behaviors have also become controllable with CSS.

The scroll-snap property ensures that elements "lock" into specific points during scrolling.

This feature is used particularly in sliders, galleries, and mobile app-like experiences.

Meanwhile, scroll-behavior: smooth improves the user experience by offering fluid transitions instead of abrupt jumps.

</>
CSS2 Features Example (+)
<!DOCTYPE html>
<html lang="tr">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS3 Modern Card Example</title>
    <link rel="stylesheet" href="style.css?v=1.0.150">
</head>

<body>

    <div class="modern-kart">
        <div class="ikon">🚀</div>
        <h2>The Power of CSS3</h2>
        <p>Rounded corners, gradient colors, shadows, and animations are now possible with just a single line of code!</p>
        <p style="font-size: 0.9em; opacity: 0.9;">(Hover over it to try)</p>
    </div>

</body>

</html>
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f0f2f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.modern-kart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    width: 300px;
    padding: 30px;
    color: white;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-kart:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.3);
}

.ikon {
    font-size: 50px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

Modern Browsers with CSS3 Support

Chrome 4+ (2010)
Firefox 3.6+ (2010)
Safari 3.1+ (2008)*
Edge (2015)
Level 4

Modern CSS (Unofficial CSS4) Logical Transformation and Modular Structure

Overview

After the revolutionary features of CSS3, the W3C stopped publishing CSS as a single large package and

transitioned to a "Modular Development" process.

Therefore, there is no official "CSS4" version; however, in the developer world,

all innovations that followed CSS3 and brought "Programming Logic" to the language are gathered under the umbrella of "Modern CSS" or unofficially CSS4.

This era marks the point where CSS ceased to be just a styling language and transformed into an intelligent architecture capable of performing logical operations.

CSS is Now Programmable: Custom Properties (Variables)

For years, the greatest shortcoming of CSS was its inability to store a value in memory.

The --variable-name structure introduced with Modern CSS brought the concept of a "Variable" to CSS from the programming world.

Philosophy: "Centralized Management." It is no longer necessary to search for the site's main color across 50 different files.

You can assign a color code to a single variable and use that variable throughout the entire site (var(--primary-color)).

This is a vital step for theme management ( Dark/Light Mode ) and the maintenance of large-scale projects.

The Parent Selector: :has()

With Modern CSS, our stylesheet is no longer just a blind tool that finds elements; it has transformed into an intelligent system capable of making logical decisions.

This is perhaps the greatest revolution in CSS history, one that web developers dreamed of for 20 years.

For years, the rule in CSS was:

"You can style from top to bottom ( from parent to child ), but you can never look back ( from child to parent )." :has() broke this rule.

Now we can tell the browser: "If there is an image inside this box, make the border of the box red."

This feature has made it possible to perform complex conditional styling—which previously could only be done with JavaScript—using pure CSS and with much higher performance.

Logical Grouping Selectors: :is() and :where()

These are the superpowers that increase code readability and manageability in large projects.

Previously, to apply the same style to different headings, one had to write lengthy selector chains spanning meters.

These selectors bring the principle of "Don't Repeat Yourself" to CSS, allowing multiple conditions to be gathered within a single set of parentheses.

This not only reduces the size of the CSS file but also lightens the browser's load in reading the code.

App-like Experience: Scrolling and Layout

To transform websites into platforms that are not just "read" but "felt" like mobile apps, dependency on JavaScript has been reduced, and the browser's own engine has been strengthened.

Scroll Snap (Magnetic Scrolling): As seen in Instagram stories or TikTok videos, this feature ensures that when you swipe, the content does not stop halfway but snaps into place on the next element "like a magnet."

While heavy JavaScript libraries were previously required to achieve this, it is now a native capability of CSS.

This feature provides the user with a smooth, controlled, and professional gallery/presentation experience, especially on touchscreens.

Logical Units and calc(): CSS now understands not just fixed numbers, but mathematical formulas as well.

Thanks to the calc() function, complex calculations such as "Subtract 50 pixels from the entire screen" (100% - 50px) can be performed dynamically.

It is a critical tool for building "fluid" layouts that adapt instantly to different screen sizes and devices.

Beyond Visual Boundaries: Wide Colors and Variable Fonts

With the advancement of hardware technology, CSS has also evolved to leverage this capacity.

Wide Color Gamut (P3 Colors): Standard web colors ( sRGB ) were pale compared to the colors that modern screens ( Apple Retina, OLED, etc. ) could display.

With support for the P3 color space, CSS has now introduced those highly vivid, neon, and bright colors that the human eye can see but old monitors could not display

( High Definition Color ).

This is a visual leap that allows websites to appear as vibrant and impressive as printed magazines.

Variable Fonts:

These are the hidden heroes of web performance ( Site Speed ).

Previously, if a site used bold, light, and italic versions of a typeface, the browser had to download 3-4 different font files; this slowed down the site.

With variable font technology, only a single file is loaded.

Attributes such as font weight, slant, or width are calculated instantly via mathematical interpolation.

This provides both unlimited design freedom and tremendously increases site load speed.

Modern CSS (Unofficial CSS4) Logical Operations and Intelligent Style Management

Custom Properties (Variables)

After CSS3, the W3C stopped publishing CSS as a single package and transitioned into a modular development process.

Officially, there is no CSS4, but all innovations in the developer world are gathered under the name "Modern CSS."

This era marks the period where CSS evolved from being just a style language into an intelligent architecture capable of performing logical operations.

CSS variables ( --variable-name ) arrived with Modern CSS.

Using a single variable throughout the entire project simplifies the management of color, measurements, and style; it is a critical tool for themes and large projects.

Parent Selector :has() Thanks to the :has() selector, applying styles from child to parent has become possible.

For example: You can make the border of a box red if there is an image inside it.

It enables conditional styling without using JavaScript.

Logical Grouping Selectors :is() and :where() Multiple selectors can be gathered within a single parenthesis using :is() and :where(), preventing code repetition and making CSS files readable and manageable.

Fluid Layout and Scrolling Thanks to features like Scroll Snap and calc(), content can be aligned smoothly, dynamic layouts can be created based on screen size, and thus app-like experiences are created.

Wide Colors and Variable Fonts With P3 color support and variable fonts, websites are now more vibrant and faster.

Weight, slant, and width can be adjusted with a single font file; performance increases and design freedom rises.

</>
CSS4 Features Example (+)
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Modern CSS (CSS4) Example</title>
    <link rel="stylesheet" href="style.css?v=1.0.150">
</head>

<body>

    <div class="liste">
        <div class="kart">
            <span>Standard Product</span>
            <span class="etiket">In Stock</span>
        </div>

        <div class="kart">
            <span>Super Deal</span>
            <span class="etiket etiket-yeni">NEW!</span>
        </div>

        <div class="kart">
            <span>Old Season</span>
            <span class="etiket">On Sale</span>
        </div>
    </div>

</body>

</html>
:root {
      --ana-renk: #6366f1;
    --vurgu-renk: #ef4444;
    --bg-renk: #f8fafc;
    --kart-bg: #ffffff;
    --golge: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-renk);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}

.liste {
    display: grid;
    gap: 20px;
}

.kart {
    background: var(--kart-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--golge);
    border: 2px solid transparent;
    width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}


.kart:has(.etiket-yeni) {
    border-color: var(--vurgu-renk);
    background-color: #fef2f2;
}

.etiket {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 20px;
    background: #e2e8f0;
    color: #475569;
}

.etiket-yeni {
    background: var(--vurgu-renk);
    color: white;
    font-weight: bold;
}

Modern Browsers Supporting CSS4 Features

Chrome 105+ (2022)
Firefox 121+ (2024)
Safari 15.4+ (2022)
Edge 105+ (2022)

To check the browser support of CSS features, you can use the Can I Use (caniuse.com) website. This site is a standard reference resource among web developers.

Level 4

The CSS Ecosystem Helper Tools and Frameworks

Overview

The CSS rules, syntax, and selectors we have learned so far are referred to in the web development world as "Vanilla CSS."

This fundamental knowledge is like knowing how to use bricks, mortar, and trowels to build a house; without this knowledge, a solid structure cannot be established.

However, the modern web world does not consist only of single-story houses; we need to build skyscrapers with thousands of rooms

( e-commerce sites, social media platforms, admin panels ).

At this point, laying every brick individually by hand becomes impossible in terms of time and creates a process prone to human error.

CSS Management in Large Projects

In large-scale real-world projects, the greatest enemies of developers are "time" and "complexity."

Writing thousands of lines of CSS code from scratch, testing them in every browser, and working in harmony with team members requires a massive workforce.

To solve this problem, the web community has created its own "Ecosystem" over time.

This ecosystem consists of powerful tools that take the weight off the developer's shoulders, automate repetitive tasks, and ensure standardization.

These tools solve issues that CSS cannot do easily or struggles with ( such as variable usage, mathematical operations, rapid layout creation ), transforming the process of writing code from a mere "writing" task into an efficient "engineering" process.

Remember; these tools do not replace CSS; they enhance the power of CSS and make it manageable.

CSS Frameworks Ready-made Architectures and Productivity Tools

Overview

Learning the fundamentals of CSS is a necessity; however, in the real world, when it comes to tight deadlines and large-scale projects, writing every line of code from scratch may not always be the most efficient path.

At this point, where developers act on the principle of "not reinventing the wheel," CSS Frameworks come into play.

These frameworks are ready-to-use style libraries written by expert developers worldwide, tested on thousands of different devices, and cleared of browser compatibility issues.

Using a framework is like using sturdy and measured ready-made blocks from a factory instead of casting bricks one by one when starting construction.

This approach can reduce project development times from weeks to days.

Although there are dozens of frameworks on the market, two giant names stand out in terms of their approaches (philosophies):

Bootstrap (Component-Based Approach)

Developed by the Twitter team, it is the most established framework that provides "standardization" in the web world; however, Bootstrap's philosophy

is built upon "Pre-built Components."

How It Works: You simply add a class name like .btn or .navbar to your HTML code; Bootstrap automatically applies all the color, size, shadow, and interaction code prepared for that class in the background.

Advantage: Even a non-designer developer can produce a web site or administration panel ( Dashboard ) that looks modern, tidy, and works perfectly on all devices ( mobile/desktop ) within minutes using Bootstrap.

Use Case: It is an "indispensable" choice particularly for rapid prototyping (MVP), corporate admin panels, and projects where function is prioritized and the design doesn't need to be highly unique.

Tailwind CSS (Utility-First Approach)

It is a modern approach that has completely changed web design trends in recent years, with a philosophy diametrically opposite to Bootstrap.

Tailwind does not offer you a ready-made "meal"; it offers the "ingredients" ( atomic classes ) needed to make the meal.

How It Works: There is no "pre-built button" in Tailwind, but there are specific class names.

To create a button, you combine small, single-purpose classes within the HTML element such as bg-blue-500

( blue background ), p-4 ( padding ), rounded-lg ( rounded corner), and text-white ( white text ).

Advantage: It eliminates the problem of Bootstrap sites looking alike ( the "Cookie-cutter" effect ).

It provides the developer with full control over the design at the pixel level.

Furthermore, when your project is finished, Tailwind tremendously reduces the file size by purging all unused classes.

Use Case: It is the most popular choice today for unique, brand-specific modern websites, e-commerce platforms, and projects where performance is critical.

CSS Preprocessors Adding Programming Intelligence to CSS

Introduction - General Overview

Although CSS is an excellent language for visual design, at its core, it is not a "Programming Language."

It could not establish loops, perform mathematical calculations, or run complex logical conditions ( if/else ).

While this does not pose a problem in small projects, in massive projects containing thousands of lines of code, CSS's "static" nature causes code to constantly repeat itself and become unmanageable.

This is exactly where CSS Preprocessors come into play.

These tools are "higher-level" languages that complement the missing logical side of CSS.

You write your code in a more advanced language like SASS or LESS; these tools transform the code you write into standard, pure CSS that browsers can understand.

This transformation process is technically called "Compiling."

Preprocessors turn the CSS writing process from a "Notepad" experience into an intelligent "Factory Production."

Variables - Centralized Management: By assigning color codes, font sizes, or margins to a variable ( $primary-color: #ff0000; ), you can update a color used in hundreds of places by changing just a single line.

Nesting - Visual Hierarchy: In standard CSS, to select a child element, you have to write the parent name repeatedly ( .menu ul, .menu li, .menu a ).

In preprocessors, you can write code in a nested manner, similar to the HTML structure.

This tremendously simplifies code readability and understanding which style belongs to which element.

Mixins - Ending Code Repetition: Perhaps the most powerful feature.

You can turn a frequently used style group ( such as shadowing effects or complex animation code ) into a "package" and name it.

You can then call this package anywhere you want with a single line. This is the foundation of the "Don't Repeat Yourself" (DRY) principle.

Math and Functions: You can perform addition, subtraction, and division operations within the code; and manage colors with programmatic commands like lighten the tone by 10% or darken by 20%.

SASS (Syntactically Awesome Style Sheets)

SASS is the undisputed industry standard in the web development world today.

Although it was developed based on the Ruby language, it can function in every environment today.

SCSS Syntax: SASS offers two different writing styles, but the most popular is the SCSS ( .scss ) format.

SCSS is very similar to standard CSS ( it uses curly braces and semicolons ).

This allows someone who knows standard CSS to start writing SASS with almost no effort.

Why is it the Leader?: Giant libraries like Bootstrap v4/v5 and Tailwind are built upon the SASS infrastructure.

Thanks to its modular structure, it is very easy to split style files into pieces ( _header.scss, _footer.scss ) and merge them into a single main file.

LESS (Leaner Style Sheets)

It is a JavaScript-based preprocessor. It has almost the same capabilities as SASS, but its working logic is slightly different.

Historical Role: It gained great popularity because the first versions of Bootstrap, which was once the most popular CSS framework, were written with LESS.

Use Case: Because it is very easy to integrate with JavaScript, it is still preferred in JS-heavy projects or systems with older infrastructure.

However, current trends and most modern frameworks have shifted the needle toward SASS.

🧭 Optional Reading Note

Information: This section is prepared to provide a deeper look into the background and conceptual foundations of the topics.

  • Mathematical, historical, and philosophical content can be read optionally.
  • The content level and intensity of each section may vary.
  • It is not mandatory for basic-level users; it is intended for advanced reading.
CSS Fundamentals

The Visual Language of the Web: CSS Philosophy and History

CSS (Cascading Style Sheets) is not just the makeup of the web; it is its mathematical architecture.
Below, the philosophy and history of CSS will be explained.

Main Topic Philosophical and Historical Context
Level 3

The Dawn of the Web From Functional Beginnings to Visual Pursuit

The Birth of the Web

The modern history of the internet began in 1989 within the corridors of CERN with the vision of Tim Berners-Lee.

While designing the World Wide Web (WWW), Berners-Lee's primary goal was not aesthetics, but the rapid sharing of global information.

During this period, the web was conceived as a massive digital library where scientists could share research papers and experimental data.

The Structure of Early Web Pages

The first web pages were far from today's colorful and dynamic structures. There were only black texts on a default gray background and

blue links leading to other pages.

This simplicity was not a lack of capability but a conscious choice; because HTML's job was solely to define the structure of the document.

The appearance was left entirely to the user's browser and the technical capacity of their device.

Web's Transformation into a Media Platform

In the mid-1990s, the web moved beyond academic circles and began reaching homes and offices.

Mosaic, developed by Marc Andreessen, and the subsequent Netscape Navigator were the first popular browsers capable of displaying images alongside text.

This development transformed the web from an "information repository" into a "media platform."

The Emergence of Design Needs The web was no longer just for scientists; it became a platform for artists, marketers, and brands as well.

Users began demanding web sites as impressive as magazine covers and as colorful as advertisements.

However, the HTML language was not designed to provide this visual control.

The Era of Chaos in Web Design

as design demands increased, browser manufacturers began adding visual tags to HTML.

Numerous style tags were being written within pages to center, color, or size text.

Structural codes and style codes became intertwined, creating a difficult-to-manage "digital mess."

HTML tables began to be used as layout tools, and the web became structurally cumbersome.

The Birth of the CSS Idea The idea of CSS emerged during this period when the web's visual chaos reached its peak.

The goal was to separate structural code from visual style and make web pages more organized, sustainable, and manageable.

Level 3

A Turning Point in Digital Architecture Håkon Wium Lie and the Birth of CSS

The Emergence of the Web Crisis

During that dark period when the web world was drowning in style tags and browser wars, and code became unmanageable, the solution came once again from the birthplace of the web: CERN.

Håkon Wium Lie's Proposal Working alongside Tim Berners-Lee, Norwegian computer scientist Håkon Wium Lie proposed not just a new language, but a new way of thinking for web design via an email sent to the web community on October 10, 1994.

This proposal, titled "Cascading HTML Style Sheets," was a manifesto against the flawed practices implemented until that day.

Lie saw that the future of the web depended on a sharp separation between content (HTML) and presentation (style).

Separation of Content and Presentation

According to him, HTML should only carry the structure, like the steel skeleton of a building.

The color, paint, and decoration of the building should be managed by a completely separate layer.

This separation would ensure the web remained accessible while offering designers a flexibility they never had before.

The Logic of Cascading

The most important feature that distinguished Håkon Wium Lie's proposal from other style systems (such as complex structures like DSSSL or FOSI) was the concept of "Cascading"—the first word of its name.

Web pages were being viewed on different screen sizes, in different browsers, and even via screen readers.

Therefore, style could not be determined by a single authority; rules had to flow from top to bottom like a waterfall.

Browser settings, user preferences, and site designer rules should combine with a specific mathematical weight to form the final visual result.

This approach is considered the first democratic consensus established between the designer and the user in web history.

Collaboration with Bert Bos

This visionary proposal soon caught the attention of the Dutch developer Bert Bos.

Working on his own browser, "Argo," at the time, Bos joined forces with Lie.

Lie's "Cascading" vision merged with Bos's technical knowledge to form the foundations of CSS.

Publication of the CSS1 Standard

After years of work under the W3C, the duo published the "CSS Level 1" standard in December 1996.

This moment is considered the transition to the age of maturity for web design.

Now colors, fonts, and alignments would be managed not by tags embedded within HTML code, but by a style language designed entirely for this task.

The birth of CSS transformed the web from just an information network into a solid architecture upon which design and art could be built.

Level 3

The Mathematics and Anatomy of CSS Selector and Declaration Logic

Overview

After understanding the historical process and philosophical separation, we need to look at how CSS technically performs this task.

By nature, CSS is not a "programming language" ( like Java or Python that performs computations ), but a "declarative language."

In other words, we don't tell the browser "how" to calculate an operation, but rather "what" the result should be.

This communication is based on a strictly rigid and mathematical sentence structure.

The basic unit of this dialogue established with the browser is called a "Rule Set," and this set consists of two main brains: the Selector and the Declaration Block.

The Targeting System: Selector

For a design command to function, it must first be known "to whom" it will be applied.

There can be hundreds of different elements ( paragraphs, headings, images ) on an HTML page.

The first task of CSS is to pluck the correct element out of this crowd to apply the style.

This is where the Selector comes in—it is the targeting mechanism.

The Selector is the index finger that says to the browser, "Go and find all the headings on the page" or "Find only the box with this specific name."

If the selector is defined incorrectly or is not mathematically specific enough, your style rules will either fall into a void or affect unintended elements.

Therefore, CSS mastery is less about knowing colors and more about being able to correctly manage this targeting system.

Command and Control Center: Declaration Block

After the target is determined by the selector, the browser must be told what to do with that target.

This part is the Declaration Block written between curly braces { }.

This is the kitchen where the style is defined.

A declaration block consists of a dual structure within itself called "Property" and "Value."

Property: The attribute we want to change ( such as Color, Size, or Border ).

It is the answer to the question "What do you want to change?"

Value: The new state of that attribute ( Red, 20 pixels, Bold ). It is the answer to the question "How should it be?"

To think of this structure through a real-world analogy: The Selector points to a "Car" on the street.

The Property is the car's "Color," and the Value is "Blue."

In computer language, this is expressed as Car { Color: Blue; }.

The Critical Importance of Syntax

CSS has a punctuation layout that does not tolerate errors.

Property and Value are separated from each other by a colon (:); this tells the browser, "The Property is finished; now I am stating the value."

Every command line ends with a semicolon (;).

The semicolon is the "period" in a CSS sentence.

It sends the message to the browser, "This command is finished; you may proceed to the next one."

If one of these punctuation marks is missing, the browser cannot make sense of that line—and usually the codes that follow it—and will ignore them.

Therefore, writing CSS is not just about having an aesthetic vision; it also requires a grammar discipline based on meticulous attention.