[toc]
<tag> content </tag>
<!DOCTYPE html>
<html>
<head>
<title>Your Title Here</title>
</head>
<body>
<h1>Your Website Header</h1>
<p>Yada Yada this is some text!</p>
</body>
</html>
<!DOCTYPE html>
: defines the document to be HTML<html>
: put all your html code in between these tags!<head>
: contains information about the web page – doesn’t actually show up on the webpage<title>
: title of your web page<body>
: actual content of your website: everything you want displayed should be inside the body tag<h1>
: a header element (large text, usually used for titles of sections)<p>
: a paragraph element (regular text, usually used for descriptions)TO-DO
- Create a new folder on your Desktop and name it “YourNameWebsite” (eg: mine would be GraceWebsite)
- Copy and paste the code above into your code editor
- Save the file into your folder as index.html
- Double click on your file index.html or open it in a web browser – your website should look something like this:
<h1>
and <p>
<h2></h2>
: size 2 header<h3></h3>
: size 3 header<h4></h4>
: size 4 header<h5></h5>
: size 5 header<h6></h6>
: size 6 header<a href="https://google.com/">This is a link!</a>
href
<img src="link to image here"/>
<ul>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ul>
<ol>
<li>Coffee</li>
<li>Tea</li>
<li>Milk</li>
</ol>
TO-DO
- Add at least 3 different types of elements onto your website!
<b>
or <strong>
: bold text<i>
or <em>
: italic text<small>
: small textGrouping together similar elements
<div></div>
: used as container for other HTML elements, usually as big containers
Defines a “block” section
Eg:
<div>
<h2>Pikachu</h2>
<p>Pikachu is Ash's trusty companion!</p>
<img src="https://i.pinimg.com/originals/cb/33/49/cb3349b86ca661ca61ae9a36d88d70d4.png">
</div>
<span></span>
: used as container for some text, or for smaller containers
TO-DO:
- Split up your page into at least 3 different sections, using div and span.
<p style = "color: black;">
black
, red
, blue
, green
, purple
, pink
, etc.rgb(255, 100, 50)
#f8f8f8
<p style="font-size: 200%;">
<p style = "text-align: center;">
<p style = "background-color: black;>
Group together similar elements, usually for styling and clarity purposes
All HTML elements with the same class get the same style
Classes
<div class="dogs"> content here~ </div>
IDs
<div id="goldenDog"> this is a golden dog! </div>
TO-DO:
- Separate the content on your page into classes and ids where appropriate