HTML BoilerPlate Code | DIV + Class + ID (Lecture 6)


File Path

In HTML, file paths are used to tell the browser where a file (like an image, CSS, JS, video, etc.) is located.
There are two main types of paths:

  1. Absolute Path
  2. Relative Path



1. Absolute Path Example 2. Relative Path Examples
<!DOCTYPE html>
<html>
<head>
  <title>Absolute Path Example</title>
</head>
<body>
  <!-- Loads from an external website -->
  <img src="https://www.w3schools.com/images/w3schools_green.jpg" alt="W3Schools Logo">
</body>
</html>

            
          
            
<!DOCTYPE html>
<html>
<head>
  <title>Relative Path Example</title>
  <!-- Linking CSS in same folder -->
  <link rel="stylesheet" href="style.css">
</head>
<body>
  <!-- Image inside "images" folder -->
  <img src="images/logo.png" alt="Logo">

  <!-- JavaScript in same folder -->
  <script src="script.js"></script>
</body>
</html>

            
          

Division:

ID Attribute

class Attribute


See the video lecture