Internal CSS

Now we can style our website under the head section. This is called Internal CSS. We can write <style> tag below <title> tag. Now we can style body by calling body tag.

For Example:

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

        body {
            background-color: #68f3f3 
        }
    
    </style>
</head>
<body>
    <h4>Hello World</h4>
</body>
</html>

Copy this clipboard and paste it into your code editor. It changes your color into aqua color. We use hexadecimal value. Here is one more example of Internal CSS.

Example:

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

        body {
            background-color: #68f3f3 
        }
    
        p {
            color: blue;
        }
    
    </style>
</head>
<body>
    <h4>Hello World</h4>
    <p>Hello My name is <strong>Junaid</strong> and i'm 15 year old.</p>
</body>
</html>

Now the color of the paragraph’s text tag changes to blue.

Copy the above-mentioned clipboard and check it by yourself.


Check all the CSS properties, the link is given below: https://www.w3schools.com/cssref/

Comments

Popular Posts