Web Development Deck Flashcards
Where do you put non-visible content about the HTML document?
Place the information in the HEAD element of the HTML document. This element can contain things such as TITLE or other metadata that can help your website be identified better by search engines.
Where do you put visible content about in the HTML document
Place it in the BODY element. This can include all of your written content such as text, images, links, etc. Examples of elements in the BODY include: h1, h2, p, span, div, etc.
Where do the HEAD and BODY tag go in a valid HTML document?
They go within the HTML element. HEAD will go above the BODY element.
What is the purpose of the < !DOCTYPE > declaration?
The purpose is to identify which version of HTML the page is using. It also helps a page render correctly. (Especially useful if using the box model)
Give five examples of HTML element types.
Examples of HTML elements include:
1. h1-h6 for creating headings of your content (h1 is the largest)
2. < p > for creating paragraphs in your webpage
3. < div > for creating divisions or sections
4. < img > for creating images
5. < ol > for creating ordered lists
What is the purpose of HTML attributes?
Provide extra information about a specific element → examples could be the language of a browser, an ID, or class
What is an example of an HTML entity (escape character)?
Escape characters are those that are used either to represent characters reserved for HTML (like the <, >, “, &) or for symbols such as copyright and trademark.
Examples:
1. < <
2. > >
3. & &
Need to check browsers to make sure it renders correctly though.
How do block-level elements affect the document flow?
They create a new line on the browser window that will take up the entire space of their parent element.
Examples will include: < div >, < h1 >, < /h1 >< p >< /p >< /div >
How do inline elements affect the document flow?
They appear on the same line as their neighboring elements. These can include elements that you want to create a semantic feel to your page.
Examples include: < em >, < strong >, < span >
What are the default width and height of a block-level element?
Because block elements create a new line on the browser window, they will take up the entire horizontal space of their parent container (the containing block). Their height will only take up what is necessary.
What are the default width and height of an inline element?
They will only take as much width and height as necessary –> as determined by the size of its content. It is bounded to the same dimensions as the tags they are residing in.
What is the difference between an ordered list and an unordered list in HTML?
Ordered lists <ol>: each item in a list is numbered → could use it for steps of a recipe; legal contract; something that needs to be defined by a number essentially
Unordered list </ol><ul> → begin with a bullet point. Does not indicate an order of anything [ingredient list]</ul>
Is an HTML list a block element or an inline element?
A list is a block element. It will create a new line for each of its list items & push everything else down the list.
What HTML tag is used to link to another website?
< a > Tag with the href attribute’s value being the page that you want people to go to when they click on your specific link.
If linking to another website, you would use the absolute URL.
< /a >
What is an absolute URL?
It is the full web address that you want someone to go to when they click on the link. For example, it starts with the domain name and can be followed to a specific page.
Could take you to a completely different website.
Example: google.com
What is a relative URL?
Links to pages within the SAME site. It is a shorthand version of a URL because you don’t need the domain name.
Instead, you just need the shorter name of it (most likely it will just be the name of the file instead; if it’s in the same folder). If it’s not in the same folder then it might be a little more complex.
How do you indicate the relative link to a parent directory?
You use ../ to indicate folder above the current one, then you follow it with the file name.
Example:
../index.html (home)
How do you indicate the relative link to a child directory?
Use the name of the child folder(directory), then a forward slash, then the file name
Example:
music/listings.html (page)
How do you indicate the relative link to a grand parent directory?
Repeat the ../ to indicate that you want to go UP two folders (instead of just one), then follow with the file name
Example:
../../index.html (returns user to homepage)
How do indicate the relative link to the same directory?
Just use the file name. You don’t need to include anything else since it is within the same folder/directory.
Example:
reviews.html
What is the purpose of an HTML form element?
It is where all of the form controls are located. - It’s where interactive controls for submitting the information is located.
Place to collect information from your user.
Give three examples of type attribute values for HTML form elements.
type=”text” → this is used for inserting text into a field.
type=”password” → similar to “text” but the characters are blocked out and hidden so someone cannot see it.
type=”radio” → clicking just one option (note → radio buttons cannot be deselected → use checkbox if you want them to deselect something)
type=”file” → upload a file
Is an HTML < input > element a block element or an inline element?
Input element is an inline-block element. Elements will line up next to each other. But! You can also set the height of the option.
→ So you need to make it a block element or add something like a div element to make it go onto a different line if you’d like for your options to stack
Give five examples of form control elements.
input: creates different types of form controls such as input: type = ”text”
textarea: creates multi-line elements
select: drop-down list
option: option of a drop-down list
fieldset: group elements together
button: create a button
#entry{ }