How does an internal document link affect the browser's history?
- It adds a new entry every time a link is clicked.
- It deletes the previous history of the page.
- It doesn't affect the browser's history.
- It replaces the current page's entry with the linked section.
Clicking on an internal document link (also known as an anchor link) navigates to a different part of the same page. This action does not create a new entry in the browser's history since you're not navigating to a new page; rather, you're moving within the current one. Therefore, the browser's history remains unaffected.
What is the role of the "style" attribute in HTML elements?
- To apply inline CSS styles directly to the element.
- To classify elements into different categories.
- To define element relationships.
- To specify an external resource link.
The "style" attribute in HTML allows for inline CSS styling to be directly applied to an element. While external and internal CSS are more common for styling whole websites or large parts of pages, the "style" attribute can be used to override these styles or quickly add specific styles to individual elements without needing to edit a stylesheet. It's a way to provide specific style rules to a single element.
The ______ attribute in the
tag is used to associate the image with an image map.
- imagemap
- map
- srcmap
- usemap
The usemap attribute in the
tag links the image with a specific image map defined elsewhere in the HTML document. It takes the name of the map (preceded by a #) as its value. This allows multiple areas within the image to be clickable and direct to different destinations.
The ______ tag is used to give the HTML document a title.
The tag is used within the section of an HTML document to define the title of the document, which appears on the browser's title bar or tab. It's important for SEO (Search Engine Optimization) and for usability to let users know what the webpage is about at a glance.
What is the primary difference between block and inline elements regarding content flow?
- Block elements cannot be nested inside inline elements.
- Block elements start on a new line and take up the full width available, while inline elements do not.
- Inline elements can contain block elements.
- Inline elements can have margins and paddings.
Block elements, by default, start on a new line and occupy the full width of their container, pushing content before and after to new lines. In contrast, inline elements flow within the content and only take up as much width as necessary, not causing a line break. This characteristic fundamentally affects how they shape the layout and flow of content on a web page.
How is a comment written in HTML code?
- -- Comment --
- /* Comment */
- // Comment
In HTML, comments are written between . It's essential to know this as comments can be used to provide explanations or annotations within the code, but they won't be displayed on the web page. This is different from some other programming and scripting languages where other symbols might be used for comments.
Can comments in HTML be viewed by users on the front end?
- No, they are completely hidden.
- No, they are encrypted.
- Yes, if they view the page source.
- Yes, they appear on the rendered page.
Comments in HTML won't be displayed on the rendered web page that users see in their browser. However, if a user decides to view the page source (often available via right-clicking on the page and selecting 'View Page Source'), they will be able to see all the HTML code, including the comments.
Which target attribute value is used to open a link in a new browsing context (like a new tab or window)?
- _blank
- _main
- _parent
- _self
The value _blank for the target attribute instructs the browser to open the linked document in a new browsing context, typically a new tab or window. Using this ensures that the current page remains open while the user views the content of the linked document, which can be beneficial for retaining the user on your page while allowing them to explore additional content.
Which of the following is a correct DOCTYPE declaration for HTML5?
The correct DOCTYPE declaration for HTML5 is . It is a way to tell the browser that the page should be rendered using HTML5 specifications.
The _____ attribute in the ordered list is used to manipulate the starting number.
- begin
- first
- initiate
- start
The start attribute in an ordered list (
- ) specifies the start value of the first item in the list. For instance,
- will begin the list numbering from 3. This can be useful for continuing list numbering across different sections or after interruptions in the content.