1/18
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
<!DOCTYPE html>
a document type declaration that appears at the top of an html file, and tells the browser our file is written in HTML5
<!DOCTYPE html>
<html>
Code goes here
</html>
doctype html doesn’t have a closing tag, but html does
Inside <html>, there should be two elements:
<head> contains all the info for your browser that's not visible on the page.
<body> contains all of the content that you will end up seeing on the page.
The <title> element goes
in the <head> and assigns text to the browser tab.
Attributes
Additional elements to customize an element
Attributes are usually in
name-value pairs like name=”value”
<ol type="a">
<li>Power ⚡</li>
<li>Courage 🔥</li>
<li>Wisdom 🦉</li>
</ol>
list will use letter instead of numbers
<ol type="i">
<li>Power ⚡</li>
<li>Courage 🔥</li>
<li>Wisdom 🦉</li>
</ol>
list will use roman numerals instead of numbers
class
any element can be assigned multiple class values in the form of a space separated list
example of a class
<p class="first-value second-value third-value">Hello, World</p>
id
Each element can only have one id value with no spaces. Every id value should be unique in the entire page
example of an id
<p id="value">Hello, World</p>
Additionally, id can be used to link to another part of the same page
This can be matched with an <a> anchor element's href attribute via a # hashtag symbol, followed by the identifier used for the id
The values for the class and id attributes must always be
lowercase. If their name is made of multiple words, they should be separated by dashes -.
A good way to remember class vs id is
there can be multiple students in a class, but each student should have an unique id.