HTML Flashcards

1
Q

What does the basic html structure for a website look like?

A

<!DOCTYPE html>

<html>
<head>
<title></title>
</head>
<body>
</body>
</html>

Doctype > defines what kind of file it is
The whole website needs to be embraced by the <html> opening and closing tab </html>
Then we need a head <head></head> and a body <body></body>

The title within the head-section defines how the tab will be named in the browser.

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

What is the difference between a tag and an element?

A

Tag is eg. h1
Element is <h1> lorem ipsum </h1>

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

How have the tags for bold and italic changed within the semantic html?

A

Bold was previously <b> and is now <strong>
Italic was previously <i> and is now <em> for emphasis</em></i></strong></b>

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

How do I create an ordered or unordered list in html?

A

Ordered list

<ol>
<li> lorem ipsum </li>
</ol>

Unordered list

<ul>
<li> lorem ipsum </li>
</ul>

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

What is meant by the term self-closing tag? Name a few examples.

A

Self-closing tag means that the tag stands on is own and doesn t need another tag that closes its functionality. Exmaples are <br></br> (line break), <hr> (horizontal line> but also <img></img>

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

What is meant by ‘attribute’ in html?

A

Attributes specify the tag they are applied to more. E.g. the tag <img></img> should have the attribute src=”…” alt=”xxx” height=”xx” width=”xx” to make sure the image is displayed properly.

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

What is the most breaking thing about html?

A

It is able to link to other files with the <a> tag.
<a> Name of the tag or image or headline etc. </a></a>

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

Why is there an index.html page on each website?

A

The index page is basically the home page that is loaded by servers when the url does not specify any other page to be loaded first.

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

What is meant by the term absolute file path and relative file path in html?

A

With relative file paths, the files you intend to reference are located in the same folder of your website folder structure. On the other hand, with absolute file paths, you refer to external resources located elsewhere on the web

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

Name the most important input fields you know by heart and their most important value for a standard form in HTML.

A

Forms should be started with the <form> </form> element

<input></input> enables text, name specifies the class

<input></input> checks if it s a valid email format and ensures it s typed in

<input></input> masks characters while entering them and ensures the password is longer than 5 characters.

<input></input> opens a date picker to select a date

<input></input> enables a radio button, if only one should be selected bind them in the same class (name)

<input></input> enables a checkbox

<input></input> creates a button to submit the entries with the value variable as the name

<input></input> creates a button to reset the whole form with the value variable as the name

Example:

<form>
First name: <input></input> <br></br>
Last name: <input></input> <br></br>
Email: <input></input> <br></br>
Password: <input></input> <br></br>
Birthday: <input></input> <br></br>
Gender: <br></br>
<input></input> Female
<input></input> Male
<input></input> Other <br></br>
Favorite fruits: <br></br>
<input></input> Mango
<input></input> Banana
<input></input> Apple <br></br>
Diet: <br></br>
<select>
<option>Normal</option><br></br>
<option>Vegetarian</option>
<option>Vegan</option>
<option>Other</option>
</select><br></br>
<input></input>
<input></input>
</form>

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

With what tag would you add a dropdown to a html form?

A

With the element <select> </select>
in which I name options like
<option>X1</option>
<option>X1</option>

I can specifiy the Dropdown via a name, e.g. With the element <select> </select>

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

What happens if you click the submit button when the form is coded like this

<form>
First name: <input></input>
</form>

A

The GET method will be applied, that means all specified parameters will be added to the URL to send the information to the server (also passwords).
It will be added with a ? at the end and each additional parameter will be added through a &
That is why it is so important to define the ‘name’ and the ‘value’ of each added tag to specifiy the parameter and the value the user has provided.

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

How can you comment within a html code?

A

<!-- This is a comment -->

As this is tidious to type each time the editors have most of the time shortcut.
in Sublime it’s ‘ctrl’ + Slash

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

When would you use the tags div and span? How are they differentiated?

A

The elements <div> </div> and span <span></span> can be used to cluster content to which the same styling e.g. css should apply. Basically the divide the code into sections.

<div> is used for whole blocks, whereas <span> is used for single lines.
</span></div>

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

What does the term backwards competability mean?

A

Older versions are not obsolute and can be still used when a newer/ later version of a new language, program etc. are released.

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

How can I check the Source Code of a website?

A

In google chrome on windows you can click ctrl + u to open the source code. On Mac you can go to Developer Tools and click ‘View Source’

17
Q

What is meant by the term inline elements?

A

Inline elements display in a line. They do not force the text after them to a new line.

An anchor (or link) is an example of an inline element. You can put several links in a row, and they will display in a line.

Examples of inline elements:

<a>
<strong>, <em>, <b>, <i>, <q>, <mark>
<span></span></mark></q></i></b></em></strong></a>

18
Q

What is meant by the term block elements?

A

A block-level element is an HTML element that begins a new line on a web page and extends the full width of the available horizontal space of its parent element. It creates large blocks of content like paragraphs or page divisions. In fact, most HTML elements are block-level elements.

19
Q

Name some semantic tags which are very useful to cluster your website and make your code more understandable.

A

nav,
main,
section,
article,
header,
figure and figcaption,
aside,
footer, etc.

Reminder: all of these tags are block-tags

20
Q

What is a global attribute?

A

Global attributes are attributes common to all HTML elements; they can be used on all elements, though they may have no effect on some elements.

21
Q

What is an event attribute?

A

HTML has the ability to let events trigger actions in a browser, like starting a JavaScript when a user clicks on an element.

22
Q

What does svg stand for? In which language are the graphics define? What makes it outstanding?

A

SVG stands for Scalable Vector Graphics
SVG is used to define vector-based graphics for the Web
SVG defines the graphics in XML format
Every element and every attribute in SVG files can be animated
SVG is a W3C recommendation
SVG integrates with other W3C standards such as the DOM and XSL

23
Q

How can I link a CSS style sheet to my html document?

A

In the head section I can use the self-closing element <link></link> with the following attributes

<link></link>

The href should be
./style.css > if index und css are on the same level
./styles/style.css > if index and a folder with styles are on the same level

24
Q
A