Pen Settings



CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource


Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource


Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.


<html lang="en">
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

<nav id="navbar">
    <header>CSS Documantation</header>
    <a href="#Introduction" class="nav-link">Introduction</a>
    <a href="#Prerequisites" class="nav-link">Prerequisites</a>
    <a href="#use_css" class="nav-link">Use css</a>
    <a href="#Modules" class="nav-link">Modules</a>
    <a href="#Solving_problem" class="nav-link">Solving problems</a>
    <a href="#See_also" class="nav-link">See also</a>
<main id="main-doc">
<section class="main-section" id="introduction">
        <p>Cascading Stylesheets — or CSS — is the first technology you should start learning after HTML. While HTML is used to define the structure and semantics of your content, CSS is used to style it and lay it out. For example, you can use CSS to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features.</p>
<section class="main-section" id="Prerequisites ">
        <p>You should learn the basics of HTML before attempting any CSS. We recommend that you work through our Introduction to HTML module first.

        Once you understand the fundamentals of HTML, we recommend that you learn further HTML and CSS at the same time, moving back and forth between the two topics. This is because HTML is far more interesting and much more fun to learn when you apply CSS, and you can't really learn CSS without knowing HTML.
        Before starting this topic, you should also be familiar with using computers and using the web passively (i.e., just looking at it, consuming the content). You should have a basic work environment set up as detailed in Installing basic software and understand how to create and manage files, as detailed in Dealing with files — both of which are parts of our Getting started with the web complete beginner's module.
        It is also recommended that you work through Getting started with the web before proceeding with this topic, especially if you are completely new to web development. However, much of what is covered in its CSS basics article is also covered in our CSS first steps module, albeit in a lot more detail.</p>
<section class="main-section"id="use_css">
    <header>Use css</header>
    <p>there are 3 ways to Use css</p>
        <li>inline Css </li>
        <li>internal Css </li>
        <li>external Css </li>
    <h3>inline css</h3>
        &lt;button style="color :purple"&gt;click me &lt;/button&gt;
    <h3>internal css</h3>

    <h3>external css</h3>
            &lt;!DOCTYPE html&gt;
            &lt;link rel="stylesheet" href="mystyle.css"&gt;
            &lt;h1>This is a heading&lt;/h1&gt;
            &lt;p>This is a paragraph.&lt;/p&gt;
<section class="sec2" id="modules">

        <p>This topic contains the following modules, in a suggested order for working through them. You should definitely start with the first one.

        <h3>CSS first steps</h3>
        <p>CSS (Cascading Style Sheets) is used to style and lay out web pages — for example, to alter the font, color, size, and spacing of your content, split it into multiple columns, or add animations and other decorative features. This module provides a gentle beginning to your path towards CSS mastery with the basics of how it works, what the syntax looks like, and how you can start using it to add styling to HTML.</p>
        <h3>CSS building blocks</h3>
        <p></p>This module carries on where CSS first steps left off — now you've gained familiarity with the language and its syntax, and got some basic experience with using it, its time to dive a bit deeper. This module looks at the cascade and inheritance, all the selector types we have available, units, sizing, styling backgrounds and borders, debugging, and lots more.
        The aim here is to provide you with a toolkit for writing competent CSS and help you understand all the essential theory, before moving on to more specific disciplines like text styling and CSS layout.</p>
        <h3> text</h3>
        <p> With the basics of the CSS language covered, the next CSS topic for you to concentrate on is styling text — one of the most common things you'll do with CSS. Here we look at text styling fundamentals, including setting font, boldness, italics, line and letter spacing, drop shadows and other text features. We round off the module by looking at applying custom fonts to your page, and styling lists and links.</p>
        <p>At this point we've already looked at CSS fundamentals, how to style text, and how to style and manipulate the boxes that your content sits inside. Now it's time to look at how to place your boxes in the right place in relation to the viewport, and one another. We have covered the necessary prerequisites so we can now dive deep into CSS layout, looking at different display settings, modern layout tools like flexbox, CSS grid, and positioning, and some of the legacy techniques you might still want to know about.</p>
<section class="sec2" id="solving_problem">
    <header>Solving problem</header>
    <p>Use CSS to solve common problems provides links to sections of content explaining how to use CSS to solve very common problems when creating a web page.

        From the beginning, you'll primarily apply colors to HTML elements and their backgrounds; change the size, shape, and position of elements; and add and define borders on elements. But there's not much you can't do once you have a solid understanding of even the basics of CSS. One of the best things about learning CSS is that once you know the fundamentals, usually you have a pretty good feel for what can and can't be done, even if you don't actually know how to do it yet!</p>
<section class="sec2" id="see_also">
    <header>See also</header>
    <h3>CSS on MDN</h3>
    <p>The main entry point for CSS documentation on MDN, where you'll find detailed reference documentation for all features of the CSS language. Want to know all the values a property can take? This is a good place to go.</p>




                @import url(';500&display=swap');

    box-sizing: border-box;
body {
    font-family: Ubuntu;
    font-size: 20px;

nav {
    max-width: 300px;
    background-color: #ddd;
    height: 100vh;
    border-right: 2px solid #777;
    position: fixed;

nav header {
    padding: 15px;
nav a {
    border-top: 1px solid #777;
    text-decoration: none;

main {

    font-family: Ubuntu;
    font-size: 16px;
    padding: 15px;
    line-height: 1.5;
    margin-left: 300px;
    margin-left: 10px;
header {
    font-size: 26px;
    font-weight: 500;
        flex-direction: column;
        border-right: none;
        border-bottom: 2px solid #777;
        overflow-y: scroll;
    width: 100%;