HTML Flashcards
• Where do you put non-visible content about the HTML document?
o Before the BODY element you will often see a HEAD element.
The HEAD contains information ABOUT the page
You will usually find a TITLE element inside the HEAD element.
o HEAD for metadata (self referential – data that describes data).
• Where do you put visible content about the HTML document?
o In the body element
• Where do the HEAD and BODY tags go in a valid HTML document?
o Following the html tag
o Ancestor and descendant / parent and child.
• What is the purpose of a !DOCTYPE declaration?
o Because there have been several versions of HTML, each web page should begin with a DOCTYPE declaration to tell a browser which version of HTML the page is using (although browsers usually display the page even if it is not included).
o The use of a DOCTYPE can also help the browser to render a page correctly.
• Give five examples of HTML element types.
o html tag – This tag acts as a container for every other element in the document except the !DOCTYPE tag.
o HEAD tag– Includes all the document’s metadata.
o TITLE tag – Defines the title of the document which is displayed in the browser’s title bar.
o BODY tag – Acts as a container for the document’s content that gets displayed on the browser.
o … Nearly 200 types of element types
• What is the purpose of HTML attributes?
o They provide more information about the elements
o HTML attributes can be used to change the color, size, and other features of HTML elements.
• Give an example of an HTML entity (escape character).
o These are used to escape characters that are markup sensitive in certain contexts
o ( & < > “ ‘ etc. )
• How do block-level elements affect the document flow?
o Some elements will always appear to start on a new line in the browser window. These are known as block level elements.
o The <div> element allows you to group a set of elements together in one block-level box.
o For example, you might create a <div> element for the header of your site (the logo and the navigation, or you might create a <div> element to contain comments from visitors.</div></div></div>
• How do inline elements affect the document flow?
o Some elements will ALWAYS appear to continue on the same line as their neighboring elements.
o These are known as inline elements.
• What are the default width and height of a block-level element?
o By default, the height of a block element is the height of the content, and the width is the length of the page
o Width 100% and default height of “auto”
o By default, block-level elements begin on new lines, but inline elements can start anywhere in a line.
• What are the default width and height of an inline element?
o Width and height for inline is always “auto” (adjusts to size of the content)
• What is the difference between an ordered list and an unordered list in HTML?
o Ordered lists are lists where each item in the list is numbered.
o An ordered list is created with the <ol> element and has numbers.
o (It is better to use the CSS list-style-type property covered on pages 333-335.
o Unordered lists are lists that begin with a bullet point (rather than characters that indicate order.)</ol>
• Is an HTML list a block element or an inline element?
o An HTML list is a block element.
• What HTML tag is used to link to another website?
o Links are created using the <a> element.</a>
o Users can click on anything between the opening A tag and the closing </a> tag.
o <a></a>
• What is an absolute URL?
o Absolute URLs are the FULL or absolute web address
o Includes the protocol and the domain.