Day 2: HTML & CSS
<div> ... </div>
Opening tag
Closing tag
Every tag should have an opening and closing tag.
There are a few exceptions though, such as DOCTYPE.
<div id="menu"> ... </div>
This is an attribute
This is a value
For every attribute, there is always an associated value. I.E: attr="value"
All attributes should be inside of the open tag.
A tag can have multiple attributes. Separate them like so: <div class="header" id="menu">
All HTML written should have this structure.
If we don't see it, you did something wrong.
<DOCTYPE html>
<!-- Tells the browser that this is a HTML Doc.-->
<html> <!-- Start of the html Document-->
<head>...</head>
<!-- All settings and link tags go here-->
<body>...</body>
<!--All content to be displayed on the page-->
</html>
<!DOCTYPE html>
<html>
<!--Settings-->
<head>
<meta charset="utf-8">
<title>My Page</title>
</head>
<!--Content shown on page-->
<body>
<div class="content_wrapper">
<div class="header" id="menu"></div>
<div class="main_content">
<button type="button" name="button" id="cl1"> Click Me </button>
</div>
<div class="footer"></div>
</div>
</body>
</html>
#name {
color: blue;
}
#name is the selector, color is the property and blue is the value
/*For elements, select with just the name of the element*/
p {
color: red;
text-align: center;
}
/*For ids, select using a hashtag*/
#idName {
text-align: center;
color: red;
}
/*For classes, select using a dot*/
.className {
text-align: center;
color: red;
}