Skip to content

A curated list of amazingly awesome HTML Interview Questions, resources and shiny things.

Notifications You must be signed in to change notification settings

dilip2882/Awesome-HTML-Interview-Questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 

Repository files navigation

Awesome-HTML-Interview-Questions

A curated list of amazingly awesome HTML Interview Questions, resources and shiny things.

Table of Contents

  1. HTML document
  2. HTML head
  3. HTML headings
  4. HTML paragraphs
  5. HTML links
  6. HTML images
  7. HTML buttons
  8. HTML lists

HTML Basics

HTML Document:

  1. What is HTML?
    HTML stands for Hypertext Markup Language. It is the standard markup language for creating web pages and web applications. HTML defines the structure and layout of a web document by using a variety of tags and attributes.

    ⬆ back to top

  2. What is the full form of HTML?
    HTML stands for Hypertext Markup Language.

    ⬆ back to top

  3. What is the current version of HTML?
    The current version of HTML is HTML5.

    ⬆ back to top

  4. What is the purpose of HTML?
    The purpose of HTML is to structure the content of a web page, defining elements such as headings, paragraphs, links, images, and more. HTML provides the basic building blocks for creating web pages and defining their layout and appearance.

    ⬆ back to top

  5. How do you create an HTML document?
    An HTML document is created by writing HTML code using a text editor and saving the file with a .html extension. The basic structure of an HTML document includes the doctype declaration, html, head, and body elements.

    ⬆ back to top

  6. Explain the structure of an HTML document.
    An HTML document typically consists of the following structure:

    • Doctype declaration (<!DOCTYPE html>)
    • HTML element (<html>)
      • Head element (<head>)
        • Title element (<title>)
        • Meta elements (<meta>)
      • Body element (<body>)
        • Content (e.g., headings, paragraphs, images, links)

    ⬆ back to top

  7. What is the doctype declaration in HTML?
    The doctype declaration (<!DOCTYPE html>) is an instruction to the web browser about the version of HTML in which the page is written. It ensures that the web page is displayed correctly and renders in standards mode.

    ⬆ back to top

  8. What is the difference between HTML and XHTML?
    HTML (Hypertext Markup Language) and XHTML (Extensible Hypertext Markup Language) are both markup languages used for creating web pages. The main difference between the two is that XHTML is an XML-based markup language, which means it has stricter syntax rules and requires well-formed documents.

    ⬆ back to top

  9. Can you have multiple declarations in an HTML document?
    No, an HTML document should have only one doctype declaration, and it should be placed at the beginning of the document before any other content.

    ⬆ back to top

  10. What happens if you don't include a doctype in your HTML document?
    If you don't include a doctype declaration in your HTML document, the browser may render the page in quirks mode, which can lead to inconsistencies in how the page is displayed across different browsers.

    ⬆ back to top

  11. Why is it recommended to use a doctype declaration in HTML?
    It is recommended to use a doctype declaration in HTML to ensure that the web page is rendered in standards mode, which helps achieve consistent rendering across different browsers and devices.

    ⬆ back to top

  12. What is the purpose of the tag in HTML?
    The <html> tag is the root element of an HTML document. It wraps all the content of the document and defines it as an HTML document. All other elements are descendants of the <html> element.

    ⬆ back to top

HTML Head:

  1. What is the purpose of the <head> tag in HTML?
    The <head> tag in HTML is used to define the header section of a web page. It contains meta-information about the document, such as title, links to stylesheets, meta tags, and more.

    ⬆ back to top

  2. Can you have multiple <head> tags in an HTML document?
    No, an HTML document should have only one <head> tag. It contains metadata and other essential information about the document and should be declared once.

    ⬆ back to top

  3. What are meta tags?
    Meta tags provide metadata about the HTML document. They include information such as character encoding, description, keywords, authorship, and viewport settings.

    ⬆ back to top

  4. How do you specify the character encoding in HTML?
    Character encoding is specified using the <meta charset="charset"> tag within the <head> section of an HTML document. For example,

    <head>
      <meta charset="UTF-8" />
    </head>

    ⬆ back to top

  5. What is the purpose of the <title> tag in the <head> section?
    The <title> tag specifies the title of the HTML document, which is displayed in the browser's title bar or tab. It provides a brief description of the page's content.

    ⬆ back to top

  6. How do you specify the title of an HTML document?
    The title of an HTML document is specified using the <title> tag within the <head> section. For example, <title>My Website</title>.

    ⬆ back to top

  7. What is the viewport meta tag used for?
    The viewport meta tag (<meta name="viewport" content="...">) is used to control how the webpage is displayed on different devices and screen sizes. It specifies the width, initial scale, and other properties of the viewport.

    ⬆ back to top

  8. Explain the purpose of the <meta name="description" content="..."> tag.
    The <meta name="description" content="..."> tag provides a brief summary or description of the HTML document. It is often used by search engines to display information about the page in search results.

    ⬆ back to top

  9. How do you define keywords for SEO using meta tags?
    Keywords for SEO can be defined using the <meta name="keywords" content="..."> tag within the <head> section of an HTML document. This tag specifies a comma-separated list of keywords relevant to the page content.

    ⬆ back to top

  10. What does the <meta name="robots" content="..."> tag do?
    The <meta name="robots" content="..."> tag instructs search engine crawlers on how to index and display the webpage content. It controls actions such as indexing, following links, and displaying snippets in search results.

    ⬆ back to top

  11. How can you prevent search engines from indexing a page?
    To prevent search engines from indexing a page, you can use the <meta name="robots" content="noindex"> tag within the <head> section. This tag instructs search engine crawlers not to index the page.

    ⬆ back to top

  12. Explain the use of the <meta name="author" content="..."> tag.
    The <meta name="author" content="..."> tag specifies the author or creator of the HTML document. It is used to provide attribution or credit to the individual or organization responsible for the content.

    ⬆ back to top

  13. What is the purpose of the <link> tag?
    The <link> tag is used to link external resources to an HTML document, such as stylesheets, icon files, and alternate versions of the document.

    ⬆ back to top

  14. How do you include an external stylesheet in HTML?
    An external stylesheet is included in HTML using the <link rel="stylesheet" href="path/to/stylesheet.css"> tag within the <head> section. The href attribute specifies the path to the CSS file.

    ⬆ back to top

  15. What are the different types of relationships specified in the <link> tag?
    The different types of relationships specified in the <link> tag include:

    • rel="stylesheet": Indicates a stylesheet document.
    • rel="icon": Specifies an icon for the document.
    • rel="alternate": Specifies an alternate version of the document.
    • rel="preload": Specifies a resource to be preloaded for future use.

    ⬆ back to top

  16. Explain the purpose of the <link rel="icon" href="..."> tag.
    The <link rel="icon" href="..."> tag specifies the favicon or icon for the HTML document. It is displayed in the browser's address bar, bookmarks, and tabs.

    ⬆ back to top

  17. How do you specify the favicon for a website?
    The favicon for a website is specified using the <link rel="icon" href="path/to/favicon.ico"> tag within the <head> section of the HTML document. The href attribute specifies the path to the favicon image file.

    ⬆ back to top

  18. What is the <style> tag used for?
    The <style> tag is used to define internal CSS styles within an HTML document. It allows you to specify the presentation and layout of HTML elements directly in the document.

    ⬆ back to top

  19. Can you include CSS directly within the <head> section of an HTML document?
    Yes, CSS can be included directly within the <head> section of an HTML document using the <style> tag. This is known as internal or embedded CSS.

    ⬆ back to top

  20. What is the purpose of the <base> tag?
    The <base> tag specifies the base URL for all relative URLs within an HTML document. It is used to resolve relative paths for links, images, and other resources.

    ⬆ back to top

  21. How do you specify the base URL for all relative URLs in a document?
    The base URL for all relative URLs in a document is specified using the <base href="baseURL"> tag within the <head> section of the HTML document. The href attribute specifies the base URL.

    ⬆ back to top

  22. Explain the use of the <script> tag in the <head> section.
    The <script> tag in the <head> section is used to define JavaScript code that should be executed before the document is rendered. It is commonly used to include scripts for analytics, tracking, or other purposes.

    ⬆ back to top

  23. Can you include JavaScript directly within the <head> section?
    Yes, JavaScript can be included directly within the <head> section of an HTML document using the <script> tag. However, it is recommended to place scripts at the end of the document body for better performance.

    ⬆ back to top

  24. What is the defer attribute used for in the script tag?
    The defer attribute in the <script> tag is used to defer the execution of JavaScript code until after the document has been parsed and rendered. This can improve page loading performance.

    ⬆ back to top

  25. What is async attribute used for in the script tag?
    The async attribute in the <script> tag is used to indicate that the script should be executed asynchronously, without blocking the parsing of the HTML document. This can improve page loading speed.

    ⬆ back to top

  26. How do you include an external JavaScript file in HTML?
    An external JavaScript file is included in HTML using the <script src="path/to/script.js"></script> tag within the <head> or <body> section. The src attribute specifies the path to the JavaScript file.

    ⬆ back to top

  27. What is the purpose of the <noscript> tag?
    The <noscript> tag is used to provide fallback content for browsers that do not support JavaScript or have JavaScript disabled. It allows you to include alternate content or instructions for users who cannot access JavaScript-enabled features.

    ⬆ back to top

  28. How do you specify a preferred style sheet for different media types?
    The preferred style sheet for different media types can be specified using the <link> tag with the media attribute. For example, <link rel="stylesheet" href="styles.css" media="screen"> specifies a stylesheet for screen media.

    ⬆ back to top

  29. Explain the use of the <meta http-equiv="refresh" content="..."> tag.
    The <meta http-equiv="refresh" content="..."> tag is used to automatically refresh or redirect a web page after a specified time interval. It can be used to create timed redirects or reloads.

    ⬆ back to top

  30. How do you automatically redirect a page in HTML?
    Automatic redirection in HTML can be achieved using the <meta http-equiv="refresh" content="delay;url=url"> tag within the <head> section. The delay specifies the time delay in seconds, and url specifies the target URL.

    ⬆ back to top

  31. What is the purpose of the <meta http-equiv="X-UA-Compatible" content="..."> tag?
    The <meta http-equiv="X-UA-Compatible" content="..."> tag is used to specify the compatibility mode for rendering the webpage in Internet Explorer. It allows you to control how older versions of IE handle the page.

    ⬆ back to top

  32. How do you specify the character set for an HTML document using HTTP headers?
    The character set for an HTML document can be specified using the Content-Type HTTP header with the charset parameter. For example, Content-Type: text/html; charset=UTF-8.

    ⬆ back to top

  33. What is the purpose of the <meta name="viewport" content="width=device-width, initial-scale=1.0"> tag in responsive web design?
    The <meta name="viewport" content="width=device-width, initial-scale=1.0"> tag is used to control the viewport settings and scale of the webpage on different devices. It ensures proper rendering and responsiveness on mobile devices.

    ⬆ back to top

  34. How do you specify the preferred language of the document using HTML?
    The preferred language of the document is specified using the <html lang="language"> tag within the <html> element. The lang attribute specifies the language code, such as "en" for English.

    ⬆ back to top

  35. What is the manifest attribute used for in the <html> tag?
    The manifest attribute in the <html> tag is used to specify the URL of the web application manifest file. This file contains metadata about the web application, such as its name, icons, and other properties.

    ⬆ back to top

  36. How do you link a manifest file to an HTML document?
    A manifest file is linked to an HTML document using the <link rel="manifest" href="path/to/manifest.json"> tag within the <head> section. The href attribute specifies the path to the manifest file.

    ⬆ back to top

  37. Explain the use of the <meta name="referrer" content="..."> tag.
    The <meta name="referrer" content="..."> tag specifies the referrer policy for the document. It controls how much referrer information is passed when navigating from one page to another.

    ⬆ back to top

  38. What does the no-referrer value do in the referrer meta tag?
    The no-referrer value in the referrer meta tag specifies that no referrer information should be sent when navigating from one page to another. It prevents the destination page from knowing the source page.

    ⬆ back to top

  39. How do you include Open Graph meta tags for better social sharing?
    Open Graph meta tags are included in HTML using the <meta property="og:tagname" content="..."> format within the <head> section. These tags provide metadata for social sharing platforms like Facebook.

    ⬆ back to top

  40. Explain the purpose of the <meta name="format-detection" content="..."> tag.
    The <meta name="format-detection" content="..."> tag controls automatic detection and formatting of certain content types in mobile browsers. It can be used to prevent auto-detection of phone numbers, addresses, and other content.

    ⬆ back to top

  41. How do you prevent automatic detection of phone numbers in HTML?
    Automatic detection of phone numbers in HTML can be prevented by including the <meta name="format-detection" content="telephone=no"> tag within the <head> section. This disables the automatic formatting of phone numbers.

    ⬆ back to top

  42. What is the purpose of the <meta name="theme-color" content="..."> tag?
    The <meta name="theme-color" content="..."> tag specifies the theme color for a website on mobile devices. It affects the color of the browser's address bar and other UI elements when the site is saved to the home screen.

    ⬆ back to top

  43. How do you specify the theme color for a website on mobile devices?
    The theme color for a website on mobile devices is specified using the <meta name="theme-color" content="color"> tag within the <head> section. The color attribute specifies the desired theme color.

    ⬆ back to top

  44. Explain the purpose of the <meta name="apple-mobile-web-app-capable" content="..."> tag.
    The <meta name="apple-mobile-web-app-capable" content="..."> tag is used to make a web application behave like a standalone iOS application when saved to the home screen. It allows the app to run in full-screen mode without browser chrome.

    ⬆ back to top

  45. How do you make a web application behave like a standalone iOS application?
    To make a web application behave like a standalone iOS application, you include the <meta name="apple-mobile-web-app-capable" content="yes"> tag within the <head> section. This allows the app to run in full-screen mode.

    ⬆ back to top

  46. What is the purpose of the <meta name="apple-mobile-web-app-status-bar-style" content="..."> tag?
    The <meta name="apple-mobile-web-app-status-bar-style" content="..."> tag is used to customize the appearance of the status bar in a standalone iOS web application. It allows you to control the color and style of the status bar.

    ⬆ back to top

  47. How do you customize the status bar appearance in a standalone iOS web application?
    The appearance of the status bar in a standalone iOS web application can be customized using the <meta name="apple-mobile-web-app-status-bar-style" content="style"> tag within the <head> section. The style attribute specifies the desired appearance.

    ⬆ back to top

  48. Explain the use of the <meta name="apple-mobile-web-app-title" content="..."> tag.
    The <meta name="apple-mobile-web-app-title" content="..."> tag is used to specify the title of a standalone iOS web application when saved to the home screen. It determines the name displayed below the app icon.

    ⬆ back to top

  49. How do you specify the title of a standalone iOS web application?
    The title of a standalone iOS web application is specified using the <meta name="apple-mobile-web-app-title" content="title"> tag within the <head> section. The title attribute specifies the desired title.

    ⬆ back to top

  50. What is the purpose of the <meta name="apple-touch-icon" content="..."> tag?
    The <meta name="apple-touch-icon" content="..."> tag specifies the icon for a standalone iOS web application when saved to the home screen. It determines the icon displayed on the home screen and in other areas of the operating system.

    [⬆ back to top](#table-of-contents

  51. Explain the difference between the <meta charset="UTF-8"> and <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> declarations.

  • <meta charset="UTF-8">: Specifies the character encoding of the HTML document directly within the meta tag. It is the preferred method for specifying character encoding.

  • <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">: Specifies the character encoding of the HTML document using an HTTP header. It is an older method and is less commonly used now.

    ⬆ back to top

  1. What is the purpose of the <meta> tag in HTML?
    The <meta> tag in HTML is used to provide meta-information about the document, such as character encoding, viewport settings, author information, keywords, and description. It is placed within the <head> element and does not contain visible content.

    ⬆ back to top

  2. How do you include comments in an HTML document?
    Comments in HTML are included using the <!-- --> syntax. Anything placed between <!-- and --> will be treated as a comment and will not be rendered by the browser. Comments are often used to add notes or descriptions to the code for better readability and understanding.

    <!-- This is a comment -->

    ⬆ back to top

HTML Headings

  1. What are HTML headings and why are they important?
    HTML headings are elements used to define the headings or titles of sections within a web page. They are important for organizing and structuring content, providing hierarchy and clarity to the page's layout, and improving accessibility and SEO.

    ⬆ back to top

  2. How many levels of headings are available in HTML?
    HTML provides six levels of headings, from <h1> to <h6>, with <h1> being the highest level and <h6> the lowest.

    ⬆ back to top

  3. What is the purpose of using heading tags in HTML?
    The purpose of using heading tags in HTML is to define the structure and hierarchy of content within a web page. Headings provide visual cues to users and search engines about the organization of the page and the relative importance of each section.

    ⬆ back to top

  4. Can you list all the heading tags in HTML?

    • <h1>
    • <h2>
    • <h3>
    • <h4>
    • <h5>
    • <h6>

    ⬆ back to top

  5. Explain the structure of heading tags in HTML.
    Heading tags in HTML consist of an opening tag (<h1> to <h6>) followed by the heading text and a closing tag (</h1> to </h6>). The number in the tag represents the level of the heading, with <h1> being the highest level and <h6> the lowest.

    ⬆ back to top

  6. How do you choose the appropriate heading level for your content?
    The appropriate heading level for content depends on its hierarchical importance within the document. Generally, <h1> is used for the main title or heading of the page, while subsequent headings are used for subsections, with lower levels indicating lower importance.

    ⬆ back to top

  7. Can heading tags be styled using CSS? If yes, how?
    Yes, heading tags can be styled using CSS. You can target heading elements by their tag name (e.g., h1, h2) or using classes or IDs to apply custom styles such as font size, color, margin, and more.

    ⬆ back to top

  8. What are the SEO implications of using heading tags in HTML?
    Heading tags provide semantic meaning to the content, helping search engines understand the structure and relevance of the page. Proper use of headings can improve SEO by signaling important keywords and topics to search engines.

    ⬆ back to top

  9. Is it necessary to include all heading levels (h1-h6) in a document? Why or why not?
    No, it's not necessary to include all heading levels in a document. You should use heading levels selectively based on the hierarchical structure of your content, ensuring that each heading level represents a meaningful division or subsection.

    ⬆ back to top

  10. How would you create a hierarchy of headings in HTML to represent different sections of a webpage?
    You would use higher-level headings (e.g., <h1>, <h2>) for main sections or titles and lower-level headings (e.g., <h3>, <h4>) for subsections or subheadings within those main sections.

    ⬆ back to top

  11. What is the default styling applied to heading tags in most browsers?
    The default styling for heading tags typically includes font size, weight, and margin properties, with <h1> being the largest and most prominent and <h6> being the smallest.

    ⬆ back to top

  12. Can heading tags contain other HTML elements? If yes, provide an example.
    Yes, heading tags can contain other HTML elements. For example:

    <h1>This is a heading with <span>inline</span> element.</h1>

    ⬆ back to top

  13. What is the difference between using a div with a larger font size and using a heading tag?
    Using a heading tag conveys semantic meaning to both browsers and assistive technologies, indicating that the content is a heading or title. On the other hand, using a div with a larger font size may only affect the visual presentation without providing any semantic value.

    ⬆ back to top

  14. How do screen readers interpret heading tags in HTML?
    Screen readers interpret heading tags based on their hierarchical structure, allowing users to navigate through the document's sections. Properly structured headings enhance accessibility by providing users with a clear understanding of the content's organization.

    ⬆ back to top

  15. What are some best practices for using heading tags in terms of accessibility and SEO?

    • Use heading tags to create a logical structure for your content.
    • Use only one <h1> tag per page for the main title or heading.
    • Use heading levels appropriately to indicate the hierarchy of content.
    • Ensure that the content under each heading is relevant and follows a logical sequence.
    • Avoid skipping heading levels or using headings for styling purposes only.
    • Test the accessibility of your headings using screen readers and other assistive technologies.

    ⬆ back to top

HTML Paragraphs:

  1. What is an HTML paragraph?
    An HTML paragraph is a block-level element used to represent a block of text or content in a web page. It typically starts on a new line and stretches to the full width available.

    ⬆ back to top

  2. How do you create a paragraph in HTML?
    To create a paragraph in HTML, you use the <p> tag. Simply wrap the text or content you want to include in the paragraph inside <p> opening and closing tags.

    ⬆ back to top

  3. Can you have multiple paragraphs within a single <p> tag?
    No, the <p> tag is a block-level element, and it is intended to contain only a single paragraph of text or content. If you need multiple paragraphs, you should use separate <p> tags for each paragraph.

    ⬆ back to top

  4. What are the common attributes used with the <p> tag?
    The <p> tag commonly uses the class, id, and style attributes for styling and targeting with CSS or JavaScript. Additionally, the title attribute can be used to provide additional information about the paragraph.

    ⬆ back to top

  5. How do you align text within a paragraph in HTML?
    Text alignment within a paragraph in HTML can be achieved using CSS properties such as text-align. For example, to align text to the center within a paragraph, you would use text-align: center; in your CSS.

    ⬆ back to top

  6. What is the default margin and padding applied to paragraphs in most browsers?
    The default margin and padding applied to paragraphs in most browsers vary, but typically browsers apply some margin and padding by default to create space around paragraphs.

    ⬆ back to top

  7. How do you style paragraphs using CSS?
    Paragraphs can be styled using CSS by targeting the <p> tag or its associated classes or IDs. You can apply styles such as font size, color, alignment, margins, padding, and more using CSS properties.

    ⬆ back to top

  8. Can you nest other HTML elements within a paragraph?
    No, according to HTML specifications, paragraphs should only contain phrasing content, which includes inline elements such as <a>, <span>, <strong>, etc. Block-level elements like <div> or other paragraphs should not be nested within a <p> tag.

    ⬆ back to top

  9. What are the semantic implications of using paragraphs in HTML?
    Using paragraphs in HTML helps to semantically structure the content of a web page, making it more understandable for both users and search engines. Paragraphs indicate blocks of text that are related and serve a specific purpose within the document.

    ⬆ back to top

  10. How do you create line breaks within a paragraph without using the <br> tag?
    Line breaks within a paragraph can be achieved by using CSS properties such as display: block; or white-space: pre;. These methods may affect the overall layout and styling of the paragraph.

    ⬆ back to top

  11. How do you handle whitespace within paragraphs in HTML?
    Whitespace within paragraphs in HTML is generally collapsed into a single space by default. To preserve whitespace, you can use the white-space: pre; CSS property, or wrap the text in <pre> tags.

    ⬆ back to top

  12. How do you create a paragraph with a specific width in HTML?
    You can create a paragraph with a specific width in HTML by applying CSS styles to the paragraph element using the width property. For example, <p style="width: 300px;">.

    ⬆ back to top

  13. How can you make the first letter of a paragraph stand out?
    You can make the first letter of a paragraph stand out by using the ::first-letter pseudo-element in CSS. For example, you can apply styles such as font-size, font-weight, or color to the first letter of the paragraph.

    ⬆ back to top

  14. What is the purpose of the <p> tag's title attribute?
    The title attribute of the <p> tag is used to provide additional information about the paragraph content. When a user hovers over the paragraph, the content of the title attribute is displayed as a tooltip.

    ⬆ back to top

  15. How do you create justified text alignment within a paragraph?
    Justified text alignment within a paragraph can be achieved using CSS by setting the text-align property to justify. This will align the text evenly along both the left and right edges of the paragraph.

    ⬆ back to top

  16. Is it necessary to close a <p> tag?
    Yes, it is necessary to close a <p> tag. The <p> tag represents a paragraph of text, and it is an empty element that does not require a closing tag. However, for consistency and to adhere to best practices, it is recommended to close all HTML tags.

    ⬆ back to top

HTML Links

  1. What is an HTML link and what purpose does it serve?
    An HTML link, created using the anchor tag <a>, is an element that allows users to navigate between different web pages or resources on the internet. It serves the purpose of connecting various parts of a website together, providing navigation and interaction for users.

    ⬆ back to top

  2. How do you create a hyperlink in HTML?
    You create a hyperlink in HTML using the anchor tag <a> with the href attribute, which specifies the destination URL. For example:

    <a href="https://example.com">Visit Example</a>

    ⬆ back to top

  3. What are the attributes commonly used in the anchor tag (<a>)?
    Common attributes used in the anchor tag include:

    • href: Specifies the URL of the linked page or resource.
    • target: Specifies where to open the linked document (e.g., _blank for opening in a new tab).
    • title: Provides additional information about the link (tooltip).
    • rel: Defines the relationship between the current document and the linked document.

    ⬆ back to top

  4. Explain the difference between absolute and relative URLs in HTML links.

    • Absolute URLs: Specify the complete web address of the linked resource, including the protocol (e.g., https://example.com).
    • Relative URLs: Specify the path to the linked resource relative to the current page's URL (e.g., ../images/image.jpg).

    ⬆ back to top

  5. How do you open a link in a new tab/window using HTML?
    You can open a link in a new tab/window by adding the target="_blank" attribute to the anchor tag. For example:

    <a href="https://example.com" target="_blank">Visit Example</a>

    ⬆ back to top

  6. What is the significance of the "href" attribute in the anchor tag?
    The href attribute specifies the URL of the linked resource. It is essential as it defines the destination of the link, determining where users will navigate when they click on it.

    ⬆ back to top

  7. How do you create a link that sends an email when clicked?
    To create an email link, use the mailto: scheme in the href attribute. For example:

    <a href="mailto:example@example.com">Send Email</a>

    ⬆ back to top

  8. Can you nest links within each other in HTML? If so, what are the limitations?
    No, HTML does not allow nesting of anchor tags within each other. Attempting to do so may lead to unpredictable behavior, and it is generally not considered a valid practice.

    ⬆ back to top

  9. How do you style links differently from regular text using CSS?
    You can style links differently from regular text using CSS by targeting the anchor tag <a> and applying styling properties such as color, text-decoration, and font-weight.

    ⬆ back to top

  10. How can you make a link unclickable (inactive) using HTML and CSS?
    To make a link unclickable, you can use CSS to set the pointer-events property to none. For example:

    .unclickable-link {
      pointer-events: none;
    }

    ⬆ back to top

  11. Explain the concept of anchor text in HTML links.
    Anchor text is the visible, clickable text in a hyperlink. It provides context and describes the content of the linked page or resource. Search engines use anchor text to determine the relevance of the linked page to the search query.

    ⬆ back to top

  12. What is the purpose of the "title" attribute in the anchor tag?
    The title attribute in the anchor tag provides additional information about the linked resource. It is often displayed as a tooltip when users hover over the link, offering supplementary context or descriptions.

    ⬆ back to top

  13. How do you create a download link for a file using HTML?
    To create a download link for a file, use the anchor tag <a> with the download attribute, specifying the filename to be downloaded. For example:

    <a href="path/to/file.pdf" download>Download PDF</a>

    ⬆ back to top

  14. What is a fragment identifier in HTML links? How do you use it?
    A fragment identifier in HTML links is a string of characters preceded by a hash symbol (#) that identifies a specific section or element within a webpage. It is used to navigate to a specific location within the same page. For example:

    <a href="#section2">Jump to Section 2</a>

    Here, #section2 refers to the element with the ID "section2" on the same page.

    ⬆ back to top

  15. Can you create a link that points to a specific section within the same webpage? If so, how?
    Yes, you can create an intra-page link by using a fragment identifier in the href attribute of the anchor tag. For example:

    <a href="#section2">Jump to Section 2</a>

    Here, #section2 refers to an element with the ID "section2" on the same page.

    ⬆ back to top

  16. Explain the importance of proper link labeling and accessibility considerations.
    Proper link labeling is crucial for accessibility and usability. Descriptive and meaningful link text helps users understand the purpose of the link, especially for screen reader users who rely on text-to-speech software. Accessibility considerations ensure that links are perceivable, operable, and understandable for all users, regardless of disabilities.

    ⬆ back to top

  17. How do you create a link that redirects to another webpage after a certain time delay?
    You can use JavaScript to create a link that redirects to another webpage after a time delay using the setTimeout function. For example:

    <script>
      setTimeout(function() {
        window.location.href = 'https://example.com';
      }, 5000); // Redirect after 5 seconds (5000 milliseconds)
    </script>

    ⬆ back to top

    1. How do you create a link that redirects to another webpage after a certain time delay?
      You can use JavaScript to create a link that redirects to another webpage after a time delay using the setTimeout function. For example:
    <script>
      setTimeout(function() {
        window.location.href = 'https://example.com';
      }, 5000); // Redirect after 5 seconds (5000 milliseconds)
    </script>

    ⬆ back to top

  18. What are some best practices for optimizing links for search engines (SEO)?
    Some best practices for optimizing links for SEO include:

    • Using descriptive anchor text that includes relevant keywords.
    • Avoiding generic link text like "click here" or "read more."
    • Ensuring that links are relevant to the content and context of the page.
    • Using proper HTML markup and semantic structure for links.
    • Avoiding excessive or unnatural linking practices.
    • Regularly auditing and updating links to maintain relevance and accuracy.

    ⬆ back to top

  19. How do you create a link that leads to a phone number, triggering a phone call on mobile devices?
    To create a link that leads to a phone number, use the tel: scheme in the href attribute. For example:

    <a href="tel:+1234567890">Call Us</a>

    ⬆ back to top

  20. What are the security concerns associated with HTML links, and how can they be mitigated?

    • Phishing attacks: Malicious links can lead users to fake websites designed to steal sensitive information.
    • Cross-site scripting (XSS): Links may be used to execute malicious scripts in the context of the user's browser.
    • Clickjacking: Links can be disguised to trick users into clicking them unintentionally.

    These concerns can be mitigated by:

    • Verifying the authenticity of links before clicking.
    • Avoiding clicking on suspicious or unsolicited links.
    • Implementing security measures such as Content Security Policy (CSP) to mitigate XSS attacks.
    • Using link preview features provided by browsers or security plugins to inspect URLs before clicking.

    ⬆ back to top\

HTML Images

  1. What is the HTML <img> tag used for?
    The HTML <img> tag is used to embed images into a web page. It allows the inclusion of images from both local and remote sources.

    ⬆ back to top

  2. How do you specify the source (URL) of an image in HTML?
    You specify the source (URL) of an image in HTML using the src attribute within the <img> tag. For example:

    <img src="image-url.jpg" alt="Image Description">

    ⬆ back to top

  3. Can you use relative URLs for the src attribute of an <img> tag? How?
    Yes, you can use relative URLs for the src attribute of an tag. Relative URLs are specified relative to the location of the HTML document. For example:

    <img src="images/image.jpg" alt="Image Description">

    ⬆ back to top

  4. What attributes can you use with the <img> tag?
    The <img> tag supports various attributes, including:

    • src: Specifies the URL of the image.
    • alt: Provides alternative text for the image.
    • width: Sets the width of the image.
    • height: Sets the height of the image.
    • srcset: Specifies multiple sources for the image based on device pixel density or screen size.
    • sizes: Defines the sizes of the image for different viewport widths.
    • title: Adds a tooltip text when the mouse hovers over the image.
    • loading: Specifies how the image should be loaded (e.g., "lazy" for lazy loading).
    • crossorigin: Specifies how the image should be handled when requested from a different domain.

    ⬆ back to top

  5. How do you specify alternative text for an image?
    Alternative text for an image is specified using the alt attribute of the <img> tag. For example:

    <img src="example.jpg" alt="Description of the image">

    ⬆ back to top

  6. Why is it important to provide alternative text for images?
    Providing alternative text for images is essential for accessibility purposes. It ensures that users who are visually impaired or using assistive technologies can understand the content and context of the images on a web page.

    ⬆ back to top

  7. How do you specify the width and height of an image in HTML?
    The width and height of an image can be specified using the width and height attributes of the tag, respectively. For example:

    <img src="example.jpg" alt="Description of the image" width="300" height="200">

    ⬆ back to top

  8. What are some best practices for optimizing images for web use?

    • Choose the appropriate file format (JPEG, PNG, GIF, SVG) based on the image content.
    • Compress images to reduce file size without significant loss of quality.
    • Use image dimensions that match the display size to avoid unnecessary scaling.
    • Specify image dimensions in HTML to prevent layout shifts while loading.
    • Utilize responsive images and srcset attribute for serving different resolutions.
    • Consider lazy loading for off-screen images to improve page loading performance.
    • Provide descriptive alt attributes for accessibility and SEO purposes.

    ⬆ back to top

  9. Can you use images as links? If yes, how?
    Yes, images can be used as links in HTML by wrapping the <img> tag with an <a> tag and specifying the destination URL in the href attribute of the <a> tag.

    Example:

    <a href="destination-url">
        <img src="image-url" alt="Image Description">
    </a>

    ⬆ back to top

  10. What is the difference between the "src" and "srcset" attributes?

    • src attribute: Specifies the URL of the image to be displayed.
    • srcset attribute: Allows specifying multiple sources for an image, each with its own URL and optional width descriptor. It helps the browser to choose the most appropriate image source based on device pixel density.

⬆ back to top

  1. How do you make an image responsive in HTML
    You can make an image responsive in HTML by setting its maximum width to 100% of its container using CSS. This allows the image to scale down proportionally to fit smaller screens while maintaining its aspect ratio. Example:
<img src="image-url" alt="Image Description" style="max-width: 100%; height: auto;">

⬆ back to top

  1. How can you ensure that an image is accessible to users with disabilities?
    You can ensure that an image is accessible to users with disabilities by providing descriptive alternative text using the alt attribute. This allows screen readers to convey the content of the image to visually impaired users. Additionally, you should ensure that the image has appropriate contrast, is not used as the sole method of conveying important information, and is part of a well-structured web page.

    ⬆ back to top

  2. What is the "alt" attribute, and why is it important?
    The "alt" attribute, short for alternative text, is used to provide a textual description of an image. It is important for accessibility purposes, as it allows visually impaired users who use screen readers to understand the content and purpose of the image. Additionally, if an image fails to load, the alternative text will be displayed instead, providing context to users.

    ⬆ back to top

  3. How do you align images horizontally and vertically in HTML?
    Images can be aligned horizontally using the CSS float property or by wrapping them inside block-level elements and applying CSS properties such as text-align or margin. Vertically aligning images can be achieved by setting their display property to inline-block and using the vertical-align CSS property.

    ⬆ back to top

  4. Can you use SVG images in HTML? How?
    Yes, SVG (Scalable Vector Graphics) images can be used in HTML. SVG images can be embedded directly into HTML documents using the <svg> element or referenced using the <img> element with the src attribute pointing to the SVG file. SVG images offer scalability and can be manipulated using CSS and JavaScript.

    ⬆ back to top

  5. What are the various image file formats supported in HTML?
    HTML supports various image file formats, including JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), GIF (Graphics Interchange Format), SVG (Scalable Vector Graphics), and BMP (Bitmap). Each format has its own characteristics and use cases.

    ⬆ back to top

  6. How can you preload images in HTML?
    Images can be preloaded in HTML by using the <link> tag with the rel attribute set to preload and the as attribute set to image. This allows browsers to preload images in the background, improving performance by reducing latency when the images are later referenced in the document.

    ⬆ back to top

  7. What is lazy loading, and how can you implement it for images?
    Lazy loading is a technique used to defer the loading of images until they are needed, typically when they enter the viewport. This helps improve page load times and reduces bandwidth usage. Lazy loading can be implemented using the loading attribute set to lazy in the <img> tag or by using JavaScript-based lazy loading libraries.

    ⬆ back to top

  8. How do you add captions to images in HTML?
    Captions can be added to images in HTML by wrapping the <img> tag inside a <figure> element and using the <figcaption> element to provide the caption text. This semantic structure ensures that the caption is associated with the corresponding image, aiding accessibility and SEO.

    ⬆ back to top

  9. How can you create an image map in HTML?
    An image map in HTML allows you to define clickable areas on an image that link to different destinations. This can be achieved using the <map> and <area> elements. The <map> element is used to define the image map, while the <area> elements define the clickable areas and their respective destinations.

    ⬆ back to top

HTML Buttons

  1. What is an HTML button?
    An HTML button is an interactive element that allows users to perform actions or submit forms on a web page. Buttons can be styled and customized using HTML, CSS, and JavaScript.

    ⬆ back to top

  2. How do you create a button in HTML?
    You can create a button in HTML using the <button> element. For example:

    <button>Click Me</button>

    ⬆ back to top

  3. What are the different types of buttons in HTML?
    In HTML, different types of buttons include <button>, <input type="button">, <input type="submit">, and <input type="reset">.

    ⬆ back to top

  4. How do you specify the text displayed on a button?
    The text displayed on a button is specified between the opening and closing <button> tags or using the value attribute for <input type="button">.

    ⬆ back to top

  5. How can you create a button with an image in HTML?
    You can create a button with an image in HTML by using the <button> element and inserting an <img> element inside it.

    ⬆ back to top

  6. What is the purpose of the "type" attribute in the <button> element?
    The type attribute in the <button> element specifies the type of button. It determines the behavior of the button when clicked.

    ⬆ back to top

  7. What are the values that can be assigned to the "type" attribute of a button?
    The values that can be assigned to the type attribute of a button are:

    • submit: Submits the form data.
    • reset: Resets the form fields.
    • button: Standard button (default behavior).

    ⬆ back to top

  8. Explain the difference between "submit" and "button" types of buttons in HTML.

    • <button type="submit">: Submits the form data.
    • <button type="button">: Behaves like a regular button, does not submit the form.

    ⬆ back to top

  9. How do you create a button that acts as a link in HTML?
    You can create a button that acts as a link in HTML by wrapping it in an anchor (<a>) tag or by using JavaScript to handle the button click event and redirecting to the desired URL.

    ⬆ back to top

  10. What is the purpose of the "disabled" attribute in HTML buttons?
    The disabled attribute in HTML buttons disables the button, making it non-clickable and visually indicating that it is inactive.

    ⬆ back to top

  11. How do you disable a button in HTML?
    You can disable a button in HTML by adding the disabled attribute to the button element.

    ⬆ back to top

  12. Explain the significance of the "form" attribute in the <button> element.
    The form attribute in the <button> element specifies the form to which the button belongs. It allows the button to interact with the specified form, even if it's outside of it.

    ⬆ back to top

  13. How can you style HTML buttons using CSS?
    HTML buttons can be styled using CSS by targeting their element type, class, or ID and applying various CSS properties like background-color, border, padding, font-size, etc.

    ⬆ back to top

  14. What is the purpose of the "name" attribute in HTML buttons?
    The name attribute in HTML buttons is used to identify the button's value when submitting a form.

    ⬆ back to top

  15. How do you handle button clicks in JavaScript?
    Button clicks in JavaScript can be handled by attaching event listeners to the button elements and defining callback functions to execute when the button is clicked.

    ⬆ back to top

  16. Explain the difference between the <button> element and the <input> element with type="button".

    • <button> element: Allows more complex content (such as images or other HTML elements) and supports multiline text.
    • <input type="button"> element: Limited to a single line of text or an image as its value.

    ⬆ back to top

  17. How do you create a button with rounded corners in HTML/CSS?
    You can create a button with rounded corners in HTML/CSS by applying the border-radius property to the button element.

    ⬆ back to top

  18. What is the role of the "value" attribute in HTML buttons?
    The value attribute in HTML buttons specifies the initial value of the button. It defines the text or image displayed on the button.

    ⬆ back to top

  19. How can you create a button with a tooltip in HTML?
    You can create a button with a tooltip in HTML by using the title attribute to provide the tooltip text, which will be displayed when the user hovers over the button.

    ⬆ back to top

  20. How do you create a button with different states (hover, active, focus) in CSS?
    You can create a button with different states (hover, active, focus) in CSS by using pseudo-classes such as :hover, :active, and :focus to define different styles for each state.

    ⬆ back to top

  21. Can you nest HTML elements within a <button> element?
    Yes, HTML elements can be nested within a <button> element.

    ⬆ back to top

  22. What are ARIA attributes, and how can they be used with HTML buttons to improve accessibility?
    ARIA (Accessible Rich Internet Applications) attributes are HTML attributes used to enhance the accessibility of web content for users with disabilities. They can be used with HTML buttons to provide additional information, such as roles, states, and properties, to assistive technologies.

    ⬆ back to top

  23. How do you create a button that triggers a JavaScript function without submitting a form?
    You can create a button that triggers a JavaScript function without submitting a form by attaching an event listener to the button element and calling the desired JavaScript function when the button is clicked.

    ⬆ back to top

  24. Explain the role of the "autofocus" attribute in HTML buttons.
    The autofocus attribute in HTML buttons automatically focuses on the button when the page loads, making it ready to receive user input without requiring manual selection.

    ⬆ back to top

  25. How can you create a button that opens a new window/tab when clicked?
    You can create a button that opens a new window/tab when clicked by using the window.open() method in JavaScript and attaching it to the button's click event.

    ⬆ back to top

  26. What are the HTML button attributes?
    HTML button elements can have various attributes to control their behavior and appearance. Some common attributes include:

  • type: Specifies the type of button (e.g., "button", "submit", "reset").
  • name: Specifies the name of the button, which is used when submitting form data.
  • value: Specifies the initial value of the button.
  • disabled: Indicates whether the button should be disabled.
  • onclick: Specifies a JavaScript function to execute when the button is clicked.
  • form: Specifies the form element to associate the button with.
  • autofocus: Specifies that the button should automatically get focus when the page loads.
  • formaction: Specifies the URL where to send the form data when the button is clicked (for type="submit").
  • formmethod: Specifies the HTTP method (GET or POST) to use when sending form data (for type="submit").
  • formenctype: Specifies the encoding type to use when sending form data (for type="submit").
  • formtarget: Specifies where to display the response after submitting the form (for type="submit").
  • formnovalidate: Specifies that the form data should not be validated when submitted (for type="submit").
  • formnovalidate: Specifies that the form data should not be validated when submitted (for type="submit").

⬆ back to top

HTML Lists:

  1. What is an HTML list and why is it used?
    An HTML list is a collection of items displayed vertically or horizontally in a structured format. It is used to organize and present information in a clear and concise manner, making it easier for users to read and understand.

    ⬆ back to top

  2. What are the different types of HTML lists?
    There are three types of HTML lists:

    • Unordered lists (<ul>): Lists with bullet points.
    • Ordered lists (<ol>): Lists with sequential numbering.
    • Definition lists (<dl>): Lists of terms and their corresponding definitions.

    ⬆ back to top

  3. How do you create an unordered list in HTML?
    An unordered list in HTML is created using the <ul> tag. Each list item is defined with the <li> tag.

    <ul>
      <li>Item 1</li>
      <li>Item 2</li>
      <li>Item 3</li>
    </ul>

    ⬆ back to top

  4. How do you create an ordered list in HTML?
    An ordered list in HTML is created using the <ol> tag. Each list item within the <ol> tag is marked with the <li> tag.

    <ol>
        <li>First item</li>
        <li>Second item</li>
        <li>Third item</li>
    </ol>

    ⬆ back to top

  5. What is the purpose of the <ul> tag in HTML?
    The <ul> tag in HTML is used to create an unordered list, which represents a list of items without any particular order or sequence. Each item in the list is typically preceded by a bullet point.

    ⬆ back to top

  6. What is the purpose of the <ol> tag in HTML?
    The <ol> tag in HTML is used to create an ordered list, which represents a list of items in a specific sequence or order. Each item in the list is typically preceded by a number or another marker indicating its position in the list.

    ⬆ back to top

  7. How do you create a nested list in HTML?
    To create a nested list in HTML, you simply place one list inside another list. For example:

    <ul>
        <li>Item 1</li>
        <li>Item 2
            <ul>
                <li>Subitem 1</li>
                <li>Subitem 2</li>
            </ul>
        </li>
        <li>Item 3</li>
    </ul>

    ⬆ back to top

  8. Can you have a combination of ordered and unordered lists within a single list?
    Yes, you can have a combination of ordered (<ol>) and unordered (<ul>) lists within a single parent list (<li>). This allows for creating nested lists where each nested level can be ordered or unordered independently.

    ⬆ back to top

  9. How can you change the appearance of list items using CSS?
    List items' appearance can be changed using CSS properties like list-style-type, list-style-image, list-style-position, and list-style.

    ⬆ back to top

  10. What is the default display style for <ul> and <ol> elements?
    The default display style for <ul> (unordered list) elements is list-item and for <ol> (ordered list) elements is also list-item.

    ⬆ back to top

  11. How do you specify a starting number for an ordered list?
    You can specify a starting number for an ordered list using the start attribute in the <ol> tag, like this: <ol start="3">.

    ⬆ back to top

  12. What is the purpose of the <li> tag in HTML?
    The <li> tag is used to define list items within ordered (<ol>) or unordered (<ul>) lists in HTML.

    ⬆ back to top

  13. How do you remove the default bullet points or numbering from a list?
    You can remove the default bullet points or numbering from a list using CSS. Set the list-style-type property to none for unordered lists (<ul>) or ordered lists (<ol>).

    ⬆ back to top

  14. What is the difference between an unordered list and an ordered list?
    An unordered list (<ul>) displays list items with bullet points, whereas an ordered list (<ol>) displays list items with numbering (1, 2, 3, etc.) by default.

    ⬆ back to top

  15. How can you create a horizontal list in HTML?
    You can create a horizontal list in HTML by setting the display property of list items (<li>) to inline or inline-block, or by using CSS Flexbox or CSS Grid layout.

    ⬆ back to top

  16. What are some common use cases for lists in web development?
    Common use cases for lists in web development include navigation menus, displaying sets of related items (e.g., product features, blog posts), creating dropdown menus, and organizing content hierarchically.

    ⬆ back to top

  17. How do you create a definition list in HTML?
    A definition list is created using the <dl> (definition list), <dt> (definition term), and <dd> (definition description) tags. <dt> defines the term, and <dd> defines the description.

    ⬆ back to top

  18. What is the structure of a definition list (<dl>, <dt>, <dd> tags)?

    • <dl> (Definition List): Wraps the entire list.
    • <dt> (Definition Term): Defines the term being defined.
    • <dd> (Definition Description): Defines the description of the term.

    ⬆ back to top

  19. Can you have multiple <dt> elements for a single <dd> element in a definition list?
    Yes, you can have multiple <dt> (definition term) elements for a single <dd> (definition description) element in a definition list. This allows for listing multiple terms that share the same definition.

    ⬆ back to top

  20. How can you add a background color to list items using CSS?
    You can add a background color to list items using the background-color property in CSS, targeting the <li> (list item) elements.

    ⬆ back to top

  21. What are some accessibility considerations when using lists in HTML?
    Accessibility considerations when using lists include providing meaningful list item labels, using semantic markup (<ul>, <ol>, <dl>), ensuring proper keyboard navigation, and using ARIA attributes when necessary.

    ⬆ back to top

  22. How can you add custom markers or numbering styles to list items?
    You can add custom markers or numbering styles to list items using CSS properties like list-style-type, list-style-image, and list-style.

    ⬆ back to top

  23. How do you align list items horizontally using CSS?
    You can align list items horizontally using CSS Flexbox or CSS Grid layout by setting the display property of list items (<li>) to inline or inline-block, or by using Flexbox properties like justify-content.

    ⬆ back to top

  24. How do you create a list with custom bullet points using images?
    You can create a list with custom bullet points using images by setting the list-style-image property in CSS to the URL of the image you want to use as the bullet point.

    ⬆ back to top

  25. How can you create a list with Roman numerals or letters instead of regular numbers?
    You can create a list with Roman numerals or letters instead of regular numbers by setting the type attribute of the <ol> (ordered list) element to I, i, A, a, or 1.

    ⬆ back to top

  26. What is the purpose of the list-style-type property in CSS?
    The list-style-type property in CSS is used to specify the appearance of the list item marker (bullet point or numbering) for unordered and ordered lists. It allows you to change the style of the marker to different types such as disc, circle, square, decimal, etc.

⬆ back to top

  1. How can you create a list that doesn't have any bullet points or numbering but is still structured as a list?
    You can create a list without bullet points or numbering by applying CSS styling to remove the default list styles. This can be achieved by setting the list-style-type property to none. The list items will still be structured as a list but won't have any visible markers.

⬆ back to top

  1. Can you nest different types of lists within each other?
    Yes, you can nest different types of lists within each other in HTML. For example, you can nest an unordered list (<ul>) inside an ordered list (<ol>) and vice versa. Additionally, you can also nest definition lists (<dl>) within ordered or unordered lists.

⬆ back to top

  1. How do you create a list where each item is a link?
    To create a list where each item is a link, you can simply wrap the <a> tag (anchor tag) around the content of each list item (<li>). This way, each list item will be clickable and act as a link to the specified URL.

Example:

<ul>
  <li><a href="#">Link 1</a></li>
  <li><a href="#">Link 2</a></li>
  <li><a href="#">Link 3</a></li>
</ul>

⬆ back to top

  1. How can you change the spacing between list items using CSS?
    You can change the spacing between list items using CSS by applying margin or padding properties to the list items (<li>). By adjusting the margin or padding values, you can control the spacing between individual list items, either horizontally or vertically.

Example:

   ul {
  list-style-type: none;
  padding: 0;
}

li {
  margin-bottom: 10px; /* Adjust the spacing between list items */
}

⬆ back to top

  1. What are HTML list attributes?
    HTML lists can have attributes that define various properties such as type, start, and compactness. Some commonly used HTML list attributes include:
  • type: Specifies the type of list item marker (e.g., disc, circle, square for unordered lists; 1, A, a, I, i for ordered lists).
  • start: Specifies the starting value of an ordered list.
  • compact: Deprecated attribute used to specify whether the list should be displayed more compactly.

Example:

<ul type="circle">
    <li>Item 1</li>
    <li>Item 2</li>
    <li>Item 3</li>
</ul>
<ol start="5">
    <li>Item 5</li>
    <li>Item 6</li>
    <li>Item 7</li>
</ol>

⬆ back to top

About

A curated list of amazingly awesome HTML Interview Questions, resources and shiny things.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published