Lecture 7
Lecture 7
CSS Fonts
Choosing the right font has a huge impact on how the
readers experience a website.
The right font can create a strong identity for your
brand.
Using a font that is easy to read is important. The font
adds value to your text. It is also important to choose
the correct color and text size for the font.
Generic Font Families
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier New",
monospace;
}
<div> tag
The <div> tag defines a division or a section in an
HTML document. The <div> tag is used as a
container for HTML elements - which is then styled
with CSS or manipulated with JavaScript. The <div>
tag is easily styled by using the class or id attribute.
Any sort of content can be put inside the <div> tag!
<!DOCTYPE html>
<html> <body>
<head>
<style> <div>
div { <h1>text formatting</h1>
border: 1px solid gray; <p>This text is styled with some of the text
padding: 8px; formatting properties. The heading uses the text-
} align, text-transform, and color properties.
h1 { The paragraph is indented, aligned, and the space
text-align: center; between characters is specified. The underline is
text-transform: uppercase; removed from this colored
color: #4CAF50; </p>
} </div>
p{
text-indent: 50px; </body>
text-align: justify; </html>
letter-spacing: 3px;
}
</style>
</head>
What are browser developer tools?
<ul>
<li>Unclosed elements: If an element is <strong>not closed properly,
then its effect can spread to areas you didn't intend
Overflow of content from its parent resulting in extra or unexpected scrollbars and
content being pushed out of the regular viewport area.
Inheriting browser inconsistencies leading to mixed results across browsers and
devices.
Unexpected inheritance from the cascade where multiple styles override one
another, which may cause alignment and spacing issues, among other things.
CSS resiliency failures from DOM changes, including when child elements have
gained wrapping divs or additional elements are unexpectedly added.
Debugging Overflow
p:first-of-type {
width: 800px;
max-width: calc(100% - 6rem);
margin: 3rem;
}