In this class, we are learning about HTML (HyperText Markup Language) and CSS (Cascading Style Sheets). Initially, I thought what we were doing in class was simply coding, and I had no idea what the difference was between the two.
What I have learned is that HTML serves as the framework of a website; it tells the browser what content is on the page.
For example:
html
<h1>Hello World</h1>
<p>This is a paragraph.</p>
<img src="image.webp" alt="A nice image">
HTML doesn't style or make things interactive; it just describes what’s there.
On the other hand, CSS (Cascading Style Sheets) is used to style the HTML. It decorates the content and controls aspects such as colors, fonts, spacing, and layout.
For example:
css
h1 {
color: darkblue;
font-size: 32px;
text-align: center;
}
CSS works with HTML to enhance the visual appearance of a site, but it does not add behavior or logic; it focuses solely on styling.
Finally, coding or programming languages like JavaScript and Python add logic and interactivity to web pages. In the context of web development, JavaScript is used to make things move, respond, calculate, and change Basically it adds behavior. For example, with JavaScript, you can create a button that triggers an action:
javascript
document.querySelector("button").addEventListener("click", function() {
alert("You clicked the button!");
});
JavaScript makes your site dynamic by handling forms, sliders, popups, animations, and more. Unlike HTML and CSS, it is an actual programming language that includes logic, variables, conditions, and other programming concepts.
No comments:
Post a Comment