<a href="https://www.wikipedia.org">
Go to Wikipedia
</a>
<a>
in this example.</a>
in this example.href=""
in this example.<a href="https://www.wikipedia.org" target="_blank">
<img src="/wikipedia.jpg" alt="Go to Wikipedia">
</a>
href=""
is for a
elements, to specify where to take the user when they click the link.src=""
is for img
elements, to specify the url of the image to load.label
elements, to specify which input
element it is paired with.class="" or id="".
id
should only be used once per document. A class
can and should be used repeatedly.<!DOCTYPE html>
html
element that is the ancestor of all other elements.html
element should have two children: a head
element and a body
element.head
element is where we tell the browser how to process the document; things like what title to put in the browser tab, what style sheets to load, what language to use (we will always use a character set called UTF-8, which allows for all languages as well as things like emoji), etc.body
element contains the actual content for the user.h1 {
color: maroon;
font-weight: 700;
}
h1
or all ul:
h1 {
color: maroon;
font-weight: 700;
}
ul {
list-style-type: none;
padding-left: none;
}
.company-name {
color: maroon;
font-weight: 700;
}
.unstyled-list {
list-style-type: none;
padding-left: 0;
}
<h1 class="company-name">Our Awesome Company</h1>
<ul class="unstyled-list">
<li>Our Work</li>
<li>About Us</li>
<li>Give Support</li>
</ul>
.medium-border {
border-bottom: 5px grey solid;
}
.big-padding {
padding: 100px;
}
<div class="medium-border big-padding">
<h1 class="company-name">Our Awesome Company</h1>
<ul class="unstyled-list">
<li>Our Work</li>
<li>About Us</li>
<li>Give Support</li>
</ul>
</div>
.medium-border {
border-bottom: 5px grey solid;
}
.big-padding {
padding: 200px;
}
<div class="medium-border">
« Homepage
</div>
<p class="big-padding">
Our mission is to...
</p>
style=""
attribute:<style>
element within the same HTML document is to put them in an external style sheet..css
and then add a <link>
element to the HTML file to connect it:<p style="padding: 100px;">Our mission is to...</p>
<link rel="stylesheet" href="/my_styles.css">
Or you can use my picks:
"To embed a font, copy the code into the <head> of your html:
CSS rules to specify families:
<link href="https://fonts.googleapis.com/css2?family=Crimson+Text:ital,wght@0,400;0,600;0,700;1,400;1,600;1,700&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,669;0,700;0,800;1,400;1,500;1,600;1,669;1,700;1,800;1,900&display=swap" rel="stylesheet">
font-family: 'Playfair Display', serif;
font-family: 'Crimson Text', serif;
Try using the above, or your own choices, to improve the typography of our site by changing the body and heading font families:
Another very handy web font to load is Font Awesome, where every "letter" in the font is a commonly used icon. (It's like Wing Dings, but useful!)
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.13.0/js/all.min.js"></script>
(You'll notice that we're using a <script> tag here instead of a <link> tag; that's because this is a slightly more sophisticated way of pulling in the CSS classes that we need, using yet another language: JavaScript. We'll talk more about that later. The effect is the same as linking an external stylesheet.)
Search for an icon you need here and then copy-paste the HTML for it into your document. It will be an inline <i> element with some classes that they've defined in their external style sheet; for example:
<i class="fas fa-comment"></i>
<i class="fas fa-edit"></i>
<i class="fab fa-twitter"></i>
<i class="fab fa-firstdraft"></i>
Font Awesome has gained a lot of features over the years that typical fonts don't have or need; you can read about them in the docs. For example, you can animate the icons like this.
.banner {
background-color: rgba(64, 64, 64, .5);
backdrop-filter: blur(5px);
color: white;
}