- What are HTML tags? HTML tags are special keywords enclosed in angle brackets (< >) that tell a web browser how to structure and display content on a webpage.
- What’s the difference between HTML and HTML5? HTML is the general name for HyperText Markup Language, and HTML5 is the latest launched version in 2014. HTML5 added awesome features like:
Aspect HTML HTML5
Doctype Long & complex Simple: <!DOCTYPE html>
Multimedia Needs plugins (Flash) ,
APIs None Geolocation, Web Storage, etc
- What’s the basic structure of an HTML document? Every HTML document needs a specific setup so browsers know how to read it. It’s like the blueprint for your web page. Here’s what goes in it:
<!DOCTYPE html>: Tells the browser this is an HTML5 page.
: The main container for everything else.
: Holds behind-the-scenes info like the page title or links to CSS and JavaScript.
: Where all the visible stuff goes, like text, images, or links.
- What’s the difference between a tag and an element?
A tag is just the code you write, like
or
, inside angle brackets. An element is the whole package: the opening tag, the content inside, and the closing tag. Some tags, like, are self-closing and don’t need a closing partner. So, tags are the tools, and elements are what you build with them.
Tag:
or , just the code.Element: Hi there!, the tag plus content.
What are attributes in HTML?
Attributes are extra details you add to an opening tag to give it more powers. They look like name="value". For example, they can tell a link where to go or an image what picture to show. Common ones are href for links, src for images, and id to give something a unique name.What kinds of lists can you make in HTML?
HTML lets you create three types of lists:
Ordered List (
- ): Shows items with numbers or letters (like 1, 2, 3).
Unordered List (
- ) with their descriptions (
- ).
- What does the tag do and when should you avoid it? The tag adds a line break, moving content to the next line without starting a new paragraph.
8.What is the difference between id and class attributes?id: Must be unique within the entire HTML document. It identifies a single, specific element.class: Can be reused across multiple elements on the same page to apply shared styles.
- What’s the difference between block-level and inline elements? Block-level and inline elements act differently on a web page:
Block-level elements: Take up the whole width of their space, start on a new line, and stack like boxes (e.g.,
,,
). They’re great for big sections like paragraphs or headers.
Inline elements: Only use the space their content needs, stay on the same line, and flow with text (e.g., , ,). They’re perfect for small bits like links or images within a sentence
10.What is the
tag and what do action and method do?
The tag in HTML is used to create a form that collects user input and sends it to a server for processing. It acts as a container for input elements like text boxes, checkboxes, radio buttons, and buttons.
How HTML is different from CSS?
HTML provides the structure and content of a webpage, while CSS controls its design and visual layout.11.HTML vs Css
HTMl
Defines the structure and content of a webpage
Uses tags to add elements like text, images, and links
Forms the backbone of any webpage
Determines what appears on the pageCSS
Styles and formats the appearance of the webpage
Uses selectors and properties to control colors, fonts, spacing, etc.
Enhances visual appeal and layout
Determines how it appears- What are semantic HTML elements? Semantic HTML elements clearly describe their purpose (e.g., , , , ), making code readable, improving accessibility, and helping SEO.
Improves accessibility for screen readers.
Helps search engines understand page structure.
- ): Uses bullets for items.
Description List (
- ): Pairs terms (
Top comments (0)