What is HTML?
HTML stands for HyperText Markup Language. It is the standard markup language for creating web pages and web applications. It describes the structure of a web page.
What is CSS?
CSS stands for Cascading Styles Sheet. It is a style sheet language used for describing the presentation of a document written in HTML. CSS describes how HTML elements should be displayed on a screen.
What is the main difference between HTML and CSS?
Think of HTML as the skeleton and structural foundation that defines the content of a webpage, while CSS is the skin and clothing used to style that content and determine how it looks. Essentially, HTML provides the raw data and organization, whereas CSS controls the layout, colors, and overall visual presentation..
Why do we put CSS in a separate file?
Externalizing CSS allows you to update the look of an entire website by editing a single file, rather than modifying every individual page. It also improves performance because browsers can cache the stylesheet, leading to faster load times for returning visitors.
What is the difference between an H1 and a P tag?
The 'H1' tag serves as your page's primary headline to tell search engines and users what the content is about, while the 'P' tag handles the actual body paragraphs. Think of the 'H1' as a book's title and the 'P' as the regular text on the pages inside.
What does the 'alt' attribute do in an <img> tag?
The 'alt' attribute provides a text description of an image that appears if the file fails to load or is read aloud by screen readers for visually impaired users. It's also a key factor for SEO, as it helps search engines understand what the image represents.
How do I link to another page?
You use the 'a' (anchor) tag with the href attribute to point to the destination URL. If you want the link to open in a new tab make sure to add the target="_blank" attribute inside the anchor tag.
What is the difference between 'class' and 'ID' in CSS?
An 'ID' is a unique identifier meant for a single element on a page, while a 'class' is a reusable label you can apply to multiple elements. Think of an 'ID' like a person's social security number and a 'class' like a designation or quality that many people can share.
What is the difference between 'margin' and 'padding' in CSS?
Padding creates space inside an element's border, while margin creates space outside of it. You use padding to push content away from the edges of a box and margin to push other elements away from the box itself.
When should I use an OL instead of a UL?
Use an 'ol' (ordered list) when the sequence of items matters, such as a recipe or step-by-step instructions. A 'ul' (unordered list) is better for a simple collection of items where the order doesn't change the meaning, like a grocery list.