Learning coding means GreatToCode Be more than a Coder ! Greattocode , Join GreatToCode Community,1000+ Students Trusted On Us .If You want to learn coding, Then GreatToCode Help You.No matter what It Takes !


CODE YOUR WAY TO A MORE FULFILLING And HIGHER PAYING CAREER IN TECH, START CODING FOR FREE Camp With GreatToCode - Join the Thousands learning to code with GreatToCode
Interactive online coding classes for at-home learning with GreatToCode . Try ₹Free Per Month Coding Classes With The Top Teachers . Learning CSS with GreatToCode

Learning CSS with GreatToCode

## Learning CSS with GreatToCode

### CSS Basics

**CSS (Cascading Style Sheets)** is used to style HTML elements on your web page. By separating the structure (HTML) from the design (CSS), you can create well-organized, visually appealing web pages.

### CSS Example

**Objective**: Learn how to apply CSS to style HTML elements such as headings, paragraphs, and links.

**HTML Code:**
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS Example</title>
    <link rel="stylesheet" href="styles.css">
</head>
<body>
    <header>
        <h1>My Awesome Webpage</h1>
    </header>
    <main>
        <p>This is a sample paragraph to demonstrate CSS styling. Enjoy learning CSS!</p>
        <a href="#">Click Me!</a>
    </main>
    <footer>
        <p>&copy; 2024 My Awesome Webpage</p>
    </footer>
</body>
</html>
```

**CSS Code (styles.css):**
```css
/* Basic Reset */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
}

header {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
}

h1 {
    margin: 0;
}

main {
    padding: 20px;
    text-align: center;
}

p {
    font-size: 18px;
    color: #333;
}

a {
    color: #1e90ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 10px 0;
    position: absolute;
    bottom: 0;
    width: 100%;
}
```

### Try It Yourself

Use the interactive editor below to experiment with the CSS code. Modify the styles to see the effects in real-time.

**HTML Editor:**
```html
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Try CSS Example</title>
    <style>
        /* Insert your CSS here */
        body {
            margin: 0;
            padding: 0;
            font-family: Arial, sans-serif;
            background-color: #f0f0f0;
        }

        header {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
        }

        h1 {
            margin: 0;
        }

        main {
            padding: 20px;
            text-align: center;
        }

        p {
            font-size: 18px;
            color: #333;
        }

        a {
            color: #1e90ff;
            text-decoration: none;
        }

        a:hover {
            text-decoration: underline;
        }

        footer {
            background-color: #333;
            color: white;
            text-align: center;
            padding: 10px 0;
            position: absolute;
            bottom: 0;
            width: 100%;
        }
    </style>
</head>
<body>
    <header>
        <h1>My Awesome Webpage</h1>
    </header>
    <main>
        <p>This is a sample paragraph to demonstrate CSS styling. Enjoy learning CSS!</p>
        <a href="#">Click Me!</a>
    </main>
    <footer>
        <p>&copy; 2024 My Awesome Webpage</p>
    </footer>
</body>
</html>
```

**Instructions:**
1. Copy the HTML code into the HTML editor above.
2. Modify the CSS code directly in the `<style>` section to see changes in real-time.
3. Experiment with different properties and values to understand how they affect the design.




Post a Comment

0 Comments

•Give The opportunity to your child with GreatToCode Kid's • Online Coding Classes for Your Kid • Introduce Your kid To the world's of coding
•Fuel You Career with our 100+ Hiring Partners, Advance Your Career in Tech with GreatToCode. •Join The Largest Tech and coding Community and Fast Forward Your career with GreatToCode. •10000+ Learner's+ 90 % placement Guarantee. • Learning Coding is Better with the GreatToCode community .
•Greattocode Kid's •GreatToCode Career •GreatToCode Interview •GreatToCode Professional •GreatToCode for schools •GreatToCode For colleges •GreatToCods For Businesses.
Are you ready to join the millions of people learning to code? GreatToCode Pass is your one-stop-shop to get access to 1000+ courses, top-notch support, and successful job placement. What are you waiting for? Sign up now and get your future in motion with GreatToCode Pass.