Intro to Programming Flashcards
Defines that this document is an HTML5 document.
<!DOCTYPE html>
This is the root element of an HTML page
<html>
</html>
It specifies a title for the HTML page (which is shown in the browser’s title bar or in the page’s tab).
<title>
</title>
It defines the document’s body, and is a container for all the visible contents, such as headings, paragraphs, images, hyperlinks, tables, lists, etc.
<body>
</body>
This element defines a large heading.
<h1>
</h1>
This element defines a paragraph.
<p>
</p>
It is defined by a start tag, some content, and an end tag
<tagname> content goes here.. </tagname>
HTML element
Provides additional information about HTML elements.
HTML attributes
Are always specified in the start tag and usually come in name/value pairs like: name=”value”
attributes
Specifies the URL of the page the link goes to.
href attribute
This tag defines a hyperlink.
<a></a>
This tag is used to embed an image in an HTML page.
<img></img>
This attribute specifies the path to the image to be displayed.
src
What are the two ways to specify the URL in the src attribute?
- Absolute URL
- Relative URL
Links an external image that is hosted on another website.
Example: src:”https;//www.w3schools.com/images/img_girl.jpg:.
Absolute URL
Links to an image that is hosted within the website. Here, the URL does not include the domain name.
Relative URL
If the URL begins without a slash, it will be relative to the _____ page.
Example: src=”img_girl.jpg.”
current
If the URL begins with a slash, it will be relative to the _____.
Example: src=”/images/img_girl.jpg”.
domain
It can control the layout of multiple web pages all at once.
CSS
A style applied to a parent element will also apply to all children elements within the parent.
cascading
CSS can be added to HTML documents in 3 ways. What are these?
- Inline
- Internal
- External
By using the style attribute inside the HTML elements.
Inline
By using a <style> element in the <head> section.</style>
Internal
By using the <link></link> element to link an external CSS file.
External
Is used to apply a unique style to a single HTML element and uses the style attribute.
Inline CSS
Is used to define a style for a single HTML page and is defined in the <head> section of an HTML page, within a <style> element.</style>
Internal CSS
Used to define the style for many HTML pages. When used, add a link to it in the <head> section of each HTML page.
External CSS