HTML & CSS Flashcards

1
Q

What is the documentation type declaration for HTML5 ?

A

<!DOCTYPE html>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is DOM?

A

DOM aka document object model is the tree-like structure describing how the HTML elements are related.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the use <head> element ?

A

The <head> element is a container for metadata (data about data) and is placed between the <html> tag and the <body> tag. Metadata is data about the HTML document. Metadata is not displayed. Metadata typically defines the document title, character set, styles, scripts, and other meta information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are HTML attributes?

A

Attributes provide additional information about elements. It is a piece of markup language used to adjust the behavior or display of an HTML element. For example, attributes can be used to change the color, size, or functionality of HTML elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How to represent comments in HTML?

A

<!-- type comment here -->

gives us a comment in HTML.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How to write HTML elements?

A

<tagname> Content goes here... </tagname>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is <br></br> tag?

A

It can be used in between elements for a line break, which is nothing but a blank self-closing element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is href attribute?

A

The <a> tag defines a hyperlink. The href attribute specifies the URL of the page the link goes to.</a>

eg:
<a> Takes to styles page </a>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Define src Attribute.

A

The <img></img> tag is used to embed an image in an HTML page. The src attribute specifies the path to the image to be displayed. It is a self closing element.

eg:
<img></img>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are two ways to specify the URL in the src attribute?

A
  1. Absolute URL: Links to an external image that is hosted on another website.
    eg:
    <img></img>
  2. 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. Example: src=”img_girl.jpg”. If the URL begins with a slash, it will be relative to the domain. Example: src=”/images/img_girl.jpg”.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the alt Attribute?

A

The required alt attribute for the <img></img> tag specifies an alternate text for an image, if the image for some reason cannot be displayed. This can be due to a slow connection, or an error in the src attribute, or if the user uses a screen reader.

eg:
<img></img>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the title Attribute?

A

The title attribute 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.

eg:

<p>This is a paragraph.</p>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are HTML headings?

A

HTML headings are titles and subtitles that you want to display on a webpage.
It’s size ranges from <h1> to <h6>

HEADINGS ARE VERY IMPORTANT!!!!!!
Search engines use the headings to index the structure and content of your web pages.

Users often skim a page by its headings. It is important to use headings to show the document structure.

<h1> headings should be used for main headings, followed by <h2> headings, then the less important <h3>, and so on.

Note: Use HTML headings for headings only. Don't use headings to make text BIG or bold.
</h3></h2></h1>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

HTML Paragraphs and Displays

A

The HTML <p> element defines a paragraph.
A paragraph always starts on a new line, and browsers automatically add some white space (a margin) before and after a paragraph.

With HTML, you cannot change the display by adding extra spaces or extra lines in your HTML code.

The browser will automatically remove any extra spaces and lines when the page is displayed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is HTML horizontal rules?

A

The <hr> tag defines a thematic break in an HTML page, and is most often displayed as a horizontal rule.
The <hr> tag is an empty tag, which means that it has no end tag.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How to have a passage displayed with space and other lines like a poem?

A

The HTML <pre> element 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.

eg:

<pre>
My Bonnie lies over the ocean.

My Bonnie lies over the sea.

My Bonnie lies over the ocean.

Oh, bring back my Bonnie to me.
</pre>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is HTML style?

A

The HTML style attribute is used to add styles to an element, such as color, font, size, and more.

<tagname>
</tagname>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is CSS background-color property defines the background color for an HTML element ?

A

The CSS background-color property defines the background color for an HTML element.

eg:

<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Text Color in HTML

A

The CSS color property defines the text color for an HTML element.

eg:

<h1>This is a heading</h1>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Fonts in CSS

A

The CSS font-family property defines the font to be used for an HTML element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Text size in CSS

A

The CSS font-size property defines the text size for an HTML element

22
Q

Text Alignment

A

The CSS text-align property defines the horizontal text alignment for an HTML element.

23
Q

HTML formatting elements

A

<b> - Bold text
<strong> - Important text
<i> - Italic text
<em> - Emphasized text
<mark> - Marked text (highlighted)
<small> - Smaller text
<del> - Deleted text (browser usually strike a line over text)
<ins> - Inserted text (browser usually underline inserted text)
- Subscript text
- Superscript text
</ins></del></small></mark></em></i></strong></b>

These are not self-closing elements, every elements need a closing tag.

24
Q

HTML Quotation

A

The HTML <blockquote> element defines a section that is quoted from another source.
Browsers usually indent <blockquote> elements.

The HTML <q> tag defines a short quotation.
Browsers normally insert quotation marks around the quotation.</q>

25
HTML Citation elements
1. HTML for abbreviations. The HTML tag 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. 2. HTML
for Contact Information The HTML
tag 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, phone number, social media handle, etc. The text in the
element usually renders in italic, and browsers will always add a line break before and after the
element. 3. HTML for Work Title The HTML tag defines the title of a creative work (e.g. a book, a poem, a song, a movie, a painting, a sculpture, etc.). Note: A person's name is not the title of a work. The text in the element usually renders in italic. 4. HTML for Bi-Directional Override BDO stands for Bi-Directional Override. The HTML tag is used to override the current text direction eg: This text will be written from right to left
26
HTML RGB Colors
An RGB color value represents RED, GREEN, and BLUE light sources. And it can be specified as an RGB value, using this formula: rgb(red, green, blue) To display white, set all color parameters to 255, like this: rgb(255, 255, 255) and it can be changed the color by experimenting the value of rgb.
27
HTML RGBA Colors
RGBA color values are an extension of RGB color values with an Alpha channel - which specifies the opacity for a color. An RGBA color value is specified with: rgba(red, green, blue, alpha) The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all)
28
HTML HEX Color Values
In HTML, a color can be specified using a hexadecimal value in the form: #rrggbb Where rr (red), gg (green) and bb (blue) are hexadecimal values between 00 and ff (same as decimal 0-255). For example, #ff0000 is displayed as red, because red is set to its highest value (ff), and the other two (green and blue) are set to 00.
29
HTML HSL Colors
HSL stands for hue, saturation, and lightness and can be specified in the form: hsl(hue, saturation, lightness) eg, hsl(0, 100%, 50%) Hue is a degree on the color wheel from 0 to 360. 0 is red, 120 is green, and 240 is blue. Saturation is a percentage value, 0% means a shade of gray, and 100% is the full color. Lightness is also a percentage value. 0% is black, and 100% is white.
30
HTML HSLA Color Values
HSLA color values are an extension of HSL color values, with an Alpha channel - which specifies the opacity for a color. An HSLA color value is specified with: hsla(hue, saturation, lightness, alpha) eg: hsla(0, 100%, 50%, 0.5) An alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all):
31
HTML Styles - CSS
CSS stands for Cascading Style Sheets CSS saves a lot of work. It can control the layout of multiple web pages all at once. With CSS, you can control the color, font, the size of text, the spacing between elements, how elements are positioned and laid out, what background images or background colors are to be used, different displays for different devices and screen sizes, and much more!
32
How to use an external CSS?
To use an external style sheet, add a link to it in the section of each HTML page. eg: The external style sheet can be written in any text editor. The file must not contain any HTML code, and must be saved with a .css extension. Here is what the "styles.css" file looks like: body { background-color: powderblue; } h1 { color: blue; } p { color: red; } Tip: With an external style sheet, you can change the look of an entire web site, by changing one file!
33
Some CSS properties
color: the color of text text-align: where elements are placed on the page background-color: can be set to any color width: in pixels or percent of a page height: in pixels or percent of a page padding: how much space should be left inside an element margin: how much space should be left outside an element font-family: type of font for text on page font-size: in pixels border: size type (solid, dashed, etc) color
34
What is HTML Links - Hyperlinks
HTML links are hyperlinks. You can click on a link and jump to another document. When you move the mouse over a link, the mouse arrow will turn into a little hand.
36
HTML Links - The target Attribute
By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link. The target attribute specifies where to open the linked document. The target attribute can have one of the following values: _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
38
Button as a Link
To use an HTML button as a link, you have to add some JavaScript code. JavaScript allows you to specify what happens at certain events, such as a click of a button: Eg:
39
How to change colors of links?
Here, an unvisited link will be green with no underline. A visited link will be pink with no underline. An active link will be yellow and underlined. In addition, when mousing over a link (a:hover) it will become red and underlined:
40
HTML Links: Create Bookmarks
To create a bookmark - first create the bookmark, then add a link to it. When the link is clicked, the page will scroll down or up to the location with the bookmark. Example First, use the id attribute to create a bookmark:

Chapter 4

Then, add a link to the bookmark ("Jump to Chapter 4"), from within the same page: Example Jump to Chapter 4 You can also add a link to a bookmark on another page: Jump to Chapter 4
41
HTML images
Images can improve the design and the appearance of a web page. eg: alternatetext Image tag is empty that means it is a self closing tag. The tag has two required attributes: 1. src - Specifies the path/URL to the image. 2. alt - Specifies an alternate text for the image.
42
Image Size - Width and Height
The style attribute to specify the width and height of an image. Eg: Girl in a jacket
43
Image Floating
The CSS float property to let the image float to the right or to the left of a text: Example

Smiley face The image will float to the right of the text.

Smiley face The image will float to the left of the text.

44
Common Image Formats supported in all browsers
Abbreviation File Format File Extension APNG Animated Portable Network Graphics .apng GIF Graphics Interchange Format .gif ICO Microsoft Icon .ico, .cur JPEG Joint Photographic Expert Group image .jpg, .jpeg, .jfif, .pjpeg, .pjp PNG Portable Network Graphics .png SVG Scalable Vector Graphics .svg
45
How to create an Image map?
The idea behind image map is that you should be able to perform different actions depending on where in the image you click.
46
What is steps for image map?
1. The image is inserted using the tag. The only difference from other images is that you must add a usemap attribute: Workplace The usemap value starts with a hash tag # followed by the name of the image map, and is used to create a relationship between the image and the image map. 2. Add a element. The element is used to create an image map, and is linked to the image by using the required name attribute. 3. Add a clickable areas using an element. You can choose one of these values for shape: rect, circle, poly, default. eg:
47
The HTML Element
The element contains one or more elements, each referring to different images through the srcset attribute. This way the browser can choose the image that best fits the current view and/or device. Each element has a media attribute that defines when the image is the most suitable. Example: Show different images for different screen sizes:
48
HTML Favicon
A favicon is a small image displayed next to the page title in the browser tab. To add a favicon to your website, either save your favicon image to the root directory of your webserver, or create a folder in the root directory called images, and save your favicon image in this folder. A common name for a favicon image is "favicon.ico". Next, add a element to your "index.html" file, after the element. </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":49,"qSoundUrl":null,"resources":{"deckId":12551799,"packId":21172889,"cardId":414246432},"returnTo":"/packs/21172889/subscribe"}' id='card-414246432'> <div class='header'> 49 </div> <div class='card-face question'> <div class='question-content'> Tables in HTML </div> </div> <div class='card-face answer'> <div class='answer-content'> Tag Description <table> Defines a table <th> Defines a header cell in a table <tr> Defines a row in a table <td> Defines a cell in a table <caption> Defines a table caption <colgroup> Specifies a group of one or more columns in a table for formatting <col> Specifies column properties for each column within a <colgroup> element <thead> Groups the header content in a table <tbody> Groups the body content in a table <tfoot> Groups the footer content in a table </div> </div> </div> <div class='flashcard-row thin-card is-blurrable' data='{"aSoundUrl":null,"cardIsBlurrable":true,"number":50,"qSoundUrl":null,"resources":{"deckId":12551799,"packId":21172889,"cardId":414247265},"returnTo":"/packs/21172889/subscribe"}' id='card-414247265'> <div class='header'> 50 </div> <div class='card-face question'> <div class='question-content'> HTML Forms </div> </div> <div class='card-face answer'> <div class='answer-content'> The HTML <form> element is used to create an HTML form for user input. An <input> element can be displayed in many ways, depending on the type attribute. for eg.: <!DOCTYPE html> <html lang="en"> <head> <title>Forms
Favorite Color: Blue Green Yellow Red