Welcome back to
ReDI School Munich - Spring 2021
Welcome back to
ReDI School Munich - Spring 2021
What's HTML?
What's HTML?
Basic Structure
Basic Structure
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<h1>Welcome!</h1>
<p>This is my first HTML site.</p>
</body>
</html>
Basic Structure
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<h1>Welcome!</h1>
<p>This is my first HTML site.</p>
</body>
</html>
<!DOCTYPE html>
π The DOCTYPE declaration is an instruction to the web browser about what version of HTML the page is written in.
<!DOCTYPE html>
<html>
</html>
π <html> tag indicates that this web page is written in HTML.
<!DOCTYPE html>
<html>
<head>
</head>
</html>
π the <head> element contains title and meta data of your web document.
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
</html>
π <title> tag contains the web page title.
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
</body>
</html>
π the <body> tag contains the content and its structure of your entire web page.
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<h1>Welcome!</h1>
</body>
</html>
π the <h1> represents the level of heading of your web page. (we'll dip dive on this)
<!DOCTYPE html>
<html>
<head>
<title>My first website</title>
</head>
<body>
<h1>Welcome!</h1>
<p>This is my first HTML site.</p>
</body>
</html>
π the <p> is simply a paragraph text that can be displayed at anywhere on your page. π
Why?
Why?
Reminder: Make sure you always have the following steps settled locally before the class starts.
index.html
file from previous homework and paste into a new folder (e.g. lesson2/index.html
)file://
in your address bardemo being presented
Let's learn a few other tags in HTML which will be important in the upcoming lessons and topics
Let's learn a few other tags in HTML which will be important in the upcoming lessons and topics
<div>
defines a division or a section in an HTML document.<img>
used to embed an image in an HTML page. (remember: img is a void element - there is no closing tag)<a>
defines a hyperlink, which is used to link from one page to another. (`a` as in anchor)<!-- SOME COMMENT -->
specifies a comment in a page (only visible for developers).ππΌ The ones you know already
<p>
represents a paragraph.<h1>, <h2> ... <h6>
used to define HTML headings, from most to less important.Reminder: Some of those tags contain important attributes!
Reminder: Some of those tags contain important attributes!
"OK, but what are attributes of a tag?" π€π
π Attributes are special words used inside the opening tag to control the element's behaviour.
<img>
attributes<html>
<head><title>Gimme more tags: images</title></head>
<body>
<img src="images/your_image.jpg"/>
</body>
</html>
<a>
attributes<html>
<head><title>Gimme more tags: anchors</title></head>
<body>
<a href="http://somewhere.com" target="_self">if you click here, this url will open in the same tab</a> <!-- default -->
<a href="http://somewhere.com" target="_blank">if you click here, you'll have another tab opening</a>
</body>
</html>
Let's all focus in the demo and afterwards we'll be doing a in-class exercise.
Let's get into group of 4 to build the following in-class exercise together:
Let's get into group of 4 to build the following website together in about 15 minutes:
dog.html
);Teacher will send you the link and password through our Zoom chat.
What's CSS?
What's CSS?
You most likely remember our tag attributes from some of the tags, don't ya?
<html>
<head><title>Inline CSS</title></head>
<body>
<p>This is unstyled text</p>
<p style="color: blue">This text is blue</p>
<p style="color: red; background-color: yellow">
Multiple properties can be separated by semicolons
</p>
</body>
</html>
Q: Still, why "inline" and what does that meanβ
A: It means we want to make sure we add styles for a few components to get an idea of how CSS works
π We will dive deeper into CSS in the next lesson.
Reference: HTML best practices π
π We will also dive deeper into inspecting elements and their styles in the upcoming lessons.
π Anyone color blind? Talk to me privately and I can propose a different exercise for you!