The heaven for Technology Learner CSS

Author - Baboolal Yadav
02 July. 2 min read

WHAT IS CSS


Using CSS

CSS can be added to HTML documents in 3 ways:


1. Inline CSS

            <h1 style="color:blue;">A Blue Heading</h1>
            <p style="color:red;">A red paragraph.</p>
        

2. Internal CSS

            <!DOCTYPE html>
            <html>
            <head>
            <style>
            body {background-color: powderblue;}
            h1   {color: blue;}
            p    {color: red;}
            </style>
            </head>
            <body>
            
            <h1>This is a h1 heading</h1>
            <p>This is a paragraph.</p>
            
            </body>
            </html>
        

3. External CSS

            <!DOCTYPE html>
            <html>
            <head>
              <link rel="stylesheet" href="styles.css">
            </head>
            <body>
            
            <h1>This is a heading</h1>
            <p>This is a paragraph.</p>
            
            </body>
            </html>
        

make "styles.css" file

         body {
              background-color: powderblue;
            }
            h1 {
              color: blue;
            }
            p {
              color: red;
            }
        

COMMENTS IN CSS

            /* This is a comment on a single line. */
            /*
               This is a comment
               that spans multiple lines.
            */
        

HISTORY OF CSS


Syntax of CSS

            p {
              color: red;
              font-size: 16px;
            }
        

CSS Margin

            p {
              margin-top: 100px;
              margin-bottom: 100px;
              margin-right: 150px;
              margin-left: 80px;
            }
                 
                 
       

CSS Padding

        div {
          padding-top: 50px;
          padding-right: 30px;
          padding-bottom: 50px;
          padding-left: 80px;
        }
      

People who read this also read

article

Learn more about Java

Author Name
07 January | 6 min read
article

Learn more about Python

Author Name
07 January | 6 min read
article

Learn more about Machine Learning techniques in India by joining this channel

Author Name
07 January | 6 min read