How To Access External Cascading Style Sheets File

admin_img Posted By Bajarangi soft , Posted On 30-10-2020

External style sheet, you can change the look of an entire website by changing just one file.Each HTML page must include a reference to the external style sheet file inside the <link> element, inside the head section.So today we access external style sheet to html file.

How To Access External Cascading Style Sheets File

Step 1: create index.html file and implement as below code in it.
 

<!DOCTYPE html>
<html>
<head>
    <link rel="stylesheet" href="mystyle.css">
</head>
<body>

<h2>Hello World!</h2>
<h3>Smaller heading!</h3>
</body>
</html>


Step 2: create mystyle.css file and implement as below code in it.
 

body {
    background: pink;
}
h2,h3 {
    text-align: center;
    color: blueviolet;
}


Complete Code For Accessing External Cascading Style Sheets File.
 

<!DOCTYPE html>
<html>
<head>
    <title>How To Access External Cascading Style Sheets File</title>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script>
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"/>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <link rel="stylesheet" href="mystyle.css">
</head>
<body>
<br/><br/>
<div class="container">
    <br><br><br>
    <div class="text-center">
        <h1 id="color" style="color: black;">How To Access External Cascading Style Sheets File</h1>
    </div>
    <br>
    <div class="well">
        <h2>Hello World!</h2>
        <h3>Smaller heading!</h3>

    </div>
    <br>
</div>
</body>
</html>

Related Post