HTML Flashcards
¿What does HTML stand for?
Hyper Text Markup Language
What does HTML do?
Describes the structure of a Web page
What is HTML composed of?
Consists of a series of elements
What is an HTML Element?
An HTML element is defined by a start tag, some content, and an end tag.
What is the difference between .htm and .html extensions?
Is one letter only, or we can say the spelling of the words (the letter ‘L’). Earlier operating systems were not so powerful and capable of taking a four-letter word as an extension, so HTM found its existence.
What is “!DOCTYPE” tag used for? and how many times can be used?
Represents the document type, and helps browsers to display web pages correctly.
It must only appear once, at the top of the page (before any HTML tags).
Which tags determine the beginning of the HTML document and which the visible part of the HTML document?
< html > < /html > and < body > < /body >
What are the “h” tags for and what number do they go up to?
They are HTML headings and go from “h1” to “h6”
What are the “p” tags for?
They are HTML paragraphs.
What are “a” tags for? What attributes do they have? and what are they for?
- They are HTML links
- They have “href” attribute
- This is where the destination link is specified.
What are “img” tags for? What attributes do they have? and what are they for?
- They are HTML images
- They have “src” , “alt” , “width” , “height” attributes
- “src” = source file, “alt” = alternative text , “width” and “height”.
What are attributes used for?
Attributes are used to provide additional information about HTML elements.
What are “br” tags for?
Defines a line break
What are “hr” tags for?
Defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
What are “pre” tags for?
Defines preformatted text.
The text inside a “pre” element is displayed in a fixed-width font (usually Courier), and it preserves both spaces and line breaks
What are “b” tags for?
Defines bold text, without any extra importance.
What are “strong” tags for?
Defines text with strong importance. The content inside is typically displayed in bold.
What are “i” tags for?
Defines a part of text in an alternate voice or mood. The content inside is typically displayed in italic.
Is often used to indicate a technical term, a phrase from another language, a thought, a ship name, etc.
What are “em” tags for?
Defines emphasized text. The content inside is typically displayed in italic.
A screen reader will pronounce the words in “em” with an emphasis, using verbal stress.
What are “small” tags for?
Defines smaller text
What are “mark” tags for?
Defines text that should be marked or highlighted
What are “del” tags for?
Defines text that has been deleted from a document. Browsers will usually strike a line through deleted text
What are “ins” tags for?
Defines a text that has been inserted into a document. Browsers will usually underline inserted text
What are “sub” tags for?
Defines subscript text. Subscript text appears half a character below the normal line, and is sometimes rendered in a smaller font. Subscript text can be used for chemical formulas
What are “sup” tags for?
Defines superscript text. Superscript text appears half a character above the normal line, and is sometimes rendered in a smaller font. Superscript text can be used for footnotes
What are “blockquote” tags for?
Defines a section that is quoted from another source. Browsers usually indent “blockquote” elements
What are “q” tags for?
Defines a short quotation. Browsers normally insert quotation marks around the quotation
What are “abbr” tags for?
Defines an abbreviation or an acronym, like “HTML”, “CSS”, “Mr.”, “Dr.”, “ASAP”, “ATM”
Marking abbreviations can give useful information to browsers, translation systems and search-engines.
What are “address” tags for?
Defines the contact information for the author/owner of a document or an article.
The contact information can be an email address, URL, physical address, etc.
The content usually renders in italic, and browsers will always add a line break before and after the element.
What are “cite” tags for?
Defines the title of a creative work.
The text in the <cite> element usually renders in italic.</cite>
What are “bdo” tags for?
Is used to override the current text direction
How can you add comments to your HTML source?
By using < !– – > but without spaces
What is the “alt” attribute for?
Specifies an alternate text for an image, if the image for some reason cannot be displayed.
What is the “style” attribute for?
Is used to add styles to an element, such as color, font, size, and more.
What is the “title” attribute for?
Defines some extra information about an element.
The value of the title attribute will be displayed as a tooltip when you mouse over the element.
What is the “target” attribute for? and what options do it have?
Specifies where to open the linked document.
_self - Default. Opens the document in the same window/tab as it was clicked
_blank - Opens the document in a new window or tab
_parent - Opens the document in the parent frame
_top - Opens the document in the full body of the window
Can you skip the end tags?
NO
Some HTML elements will display correctly, even if you forget the end tag
However, never rely on this! Unexpected results and errors may occur if you forget the end tag!
Is HTML case sensitive?
HTML tags are not case sensitive,
but W3C recommends lowercase in HTML, and demands lowercase for stricter document types like XHTML
What is an empty tag?
- It has no end tag
Can you declare a comment in the middle of a line of code?
Yes
How can you add a favicon?
Using the “link” element with “rel”=”icon”, “type”=”image/x-icon” and “href” of the icon
What is a favicon?
It is a small icon that is variously displayed, as in a browser’s address bar or next to the site name in a bookmark list.
Who invented HTML?
Tim Berners-Lee the also creator of world wide web (www)
What are the 2 ways to specify the URL in the “src” or “href” attributes? and what are their differences?
- Absolute URL = Links to an external image that is hosted on another website.
- Relative URL = Links to an image that is hosted within the website. Here, the URL does not include the domain name. If the URL begins without a slash, it will be relative to the current page.
Where should you use “lang” attribute? and why?
You should always include the lang attribute inside the “html” tag, to declare the language of the Web page.
Do we have to always use lowercase attributes?
The HTML standard does not require lowercase attribute names.
However, W3C recommends lowercase attributes in HTML, and demands lowercase attributes for stricter document types like XHTML.
Do we have to always quote attribute values?
The HTML standard does not require lowercase attribute names.
However, W3C recommends lowercase attributes in HTML.
Can you edit the content of a “p” element with spaces to change its display?
No, The browser will automatically remove any extra spaces and lines when the page is displayed
How can you change the background color of an HTML element?
Setting the CSS “background-color” property in the “style” attribute of the HTML element like:
style=”background-color:powderblue;”
How can you change the text color of an HTML element?
Setting the CSS “color” property in the “style” attribute of the HTML element like:
style=”color:blue;”
How can you change the size, style and color of the borders of an HTML element in a single CSS property?
Setting the CSS “border” property in the “style” attribute of the HTML element like:
style=”border:2px solid Tomato;”
How can you specify colors?
Colornames, RGB values, HEX values, HSL values, RGBA values, and HSLA values.
How many ways can you add CSS to HTML documents?
Inline - by using the style attribute inside HTML elements
Internal - by using a < style > element in the < head > section
External - by using a < link > element to link to an external CSS file
How can you change the font that is used for an HTML element?
Setting the CSS “font-family” property in the “style” attribute of the HTML element like:
style=”font-family:verdana;”
How can you change the text size for an HTML element?
Setting the CSS “font-size” property in the “style” attribute of the HTML element like:
style=”font-size:300%;”
How can you change the horizontal text alignment for an HTML element?
Setting the CSS “text-align” property in the “style” attribute of the HTML element like:
style=”text-align:center;”
When Inline CSS is used? and how is defined?
An inline CSS is used to apply a unique style to a single HTML element.
An inline CSS uses the style attribute of an HTML element.
When Internal CSS is used? and how is defined?
An internal CSS is used to define a style for a single HTML page.
An internal CSS is defined in the < head > section of an HTML page, within a < style > element.
When External CSS is used? and how is defined?
Is used to define the style for many HTML pages.
To use an external style sheet, add a link to it in the < head > section of each HTML page like:
< link rel=”stylesheet” href=”styles.css” >
Where do < a > links open by default?
The linked page will be displayed in the current browser window
What does “mailto:” do inside the href attribute? like in:
< a href=”mailto:someone@example.com” >Email< /a >
Create a link that opens the user’s email program (to let them send a new email)
Where specifically does the following link point to?
< a href=”html_demo.html#C4” >Jump< /a >
To the “html_demo.html” document on the element with the id “C4”
What tags are used to define a table in HTML? and what represent each one?
< table >< /table > - The begining and end of the table
< td >< /td > - Table Cells (Table Data)
< tr >< /tr > - Table Rows
< th >< /th > - Table Header (Table Column Names)