CS46

From Coder Merlin
Revision as of 02:35, 22 January 2023 by Namay-saini (talk | contribs) (Created page with "Whenever you see the div tag in HTML, think of it as the abbreviation of division. Because that’s precisely what it is! The div tag just defines a division or section of the HTML document. You can put anything you want inside this section, from a header to some body text. You know to use a div tag if your code for a website is divided into logical sections. For example, if a website was describing different kinds of fish, there would be div tags around each section de...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Within these castle walls be forged Mavens of Computer Science ...
— Merlin, The Coder

Whenever you see the div tag in HTML, think of it as the abbreviation of division. Because that’s precisely what it is! The div tag just defines a division or section of the HTML document. You can put anything you want inside this section, from a header to some body text.

You know to use a div tag if your code for a website is divided into logical sections. For example, if a website was describing different kinds of fish, there would be div tags around each section describing one type of fish.

Although div tags don’t have any visual effect on the website itself, they are still beneficial. For example, they are important to use when wanting to implement a styles CSS file within that section. The div tag also makes it easier to read your code. That way, it is much easier for developers to view it.

To make the div tag, simply write:

‘’’

‘’’

To close the div tag, write:

‘’’

‘’’

Another way of making your code much more readable is by tabbing the code within the div tag. This can be done by highlighting all the code with the div tag and pressing the tab key. That way, all the code within each div tag can be visually distinct.