Difference Between HTML, CSS, and JavaScript
HTML (HyperText Markup Language)
- Purpose: The structure and content of a webpage.
- Functionality:
* Defines the layout and elements (headings, paragraphs, images, etc.).
* Forms the skeleton of the webpage.
- Example:
<h1>Welcome to the Web</h1>
<p>This is a paragraph.</p>
<img src="image.jpg" alt="Example image">
CSS (Cascading Style Sheets)
- Purpose: Styling and visual appearance of a webpage.
- Functionality:
* Controls colors, fonts, layouts, and spacing.
* Makes webpages visually appealing and responsive.
- Example:
h1 {
color: blue;
font-size: 24px;
p{
text-align: center;
line-height: 1.5;
JavaScript
- Purpose: Adds interactivity and dynamic behavior to a webpage.
- Functionality:
* Handles user inputs, animations, and dynamic updates.
* Enables event handling and logic implementation.
- Example:
document.getElementById("demo").innerHTML = "Hello, JavaScript!";