Week 1 - Documentation
Week 1 - Documentation
Eddy
Dedan Okware
- Understand HTML
HTML (Hyper Text Markup Language) is used to structure web pages.
- Understand CSS for styling
- Understand JavaScript for interactivity
<meta char= ”UTF 8”> - Unicode transformation format using 8 bit (defined by unicode
standard and is used for electronic communication)
</head>
extensions
HTML preview
Lists (types)
<l>Football<l>
<l>Basketball<l>
</ul>
<l>Football<l>
<l>Basketball<l>
</ol>
<header>
<nav>
</nav>
</header>
</section>
<footer>
</footer>
Table tag
Attributes – border
<tr>
<th>Day</th>
<th>Activity</th>
</tr>
<tr>
<td>Monday</td>
<td>Reading</td>
</tr>
</table>
Form
<br>
<br>
<textarea name =”message” rows= “4” cols= “58” placeholder = “Enter message”>
<br>
</form
Recap
Scrimba – HTML Crash Course by teacher Kevin Powell
<! DOCTYPE html>
<html>
<head>
</head>
<body>
</body>
</html>
Document structure
Paragraphs
Regular text in your document
<p>this is a paragraph</p>
<strong> by default it is bold. Don’t use it to for bold instead use it to add importance to the
text.
<em> adds emphasis to the text. By default, it will make the text italic.
Nesting elements
Links
Images
- Use the src attribute to tell the browser where the image file is.
- Use the alt attribute to provide a description of the image.
<img src=”img/photo.jpg” alt=”alternative text photo text when image fails to load”>
Lists
CSS is all about property: value pairs i.e color: red; - must have a colon before the value and a
semicolon to tell the browser that it is finished.
Properties
- Color
- Font-size
- Font-weight
- Width
- Inline styles
- Embedded
- External
Embedded
You can write your CSS in the head of an HTML element, placing it inside a <style> element.
<head>
<style>
P{
Color: red;
</style>
</head>
External
This is the best choice. It keeps all your CSS in it’s own file, and allows it to be shared across multiple
HTML files.
<head>
</head>
Inheritance and the cascade
- Margin-left
- Margin-right
- Margin-top
- Margin-bottom
The syntax is the same as with margin, including the shorthands that we saw.
The big difference between margin and padding is that padding will include the background color(if
there is one)
Borders add a border around your element. If you are familiar with design software, they are similar
to a stroke.
Border properties
Border shorthand
border-style: solid;
border-color:yellow;
is equal to
h2{
P{
margin
border
padding
Content itself
To organize this content, we can use different elements.
<heading>
<main>
<nav>
<section>
<article>
<footer>
Selectors
In our CSS, there are three primary ways to select elements:
- Element selectors
- Class selectors
- ID selectors
Classes vs IDs
Use classes
Most people prefer using only classes and elements for styling purposes.
Spans
Spans are inline elements, similar to <em> and <strong>, but they don’t have any default styling.
Divs
Divs are used to group content, but like a span, they have no semantic meaning.
We use them to group content in order to control our layouts, for the most part.
Centering content
We can center text, which deals with alignment, and we can center elements within the viewport.
Centering text
Text-align: center
- A width
- Margin-left and margin-right of auto
Creating columns
Flexbox is a CSS layout tool.
When we declare display: flex on an element, all it’s direct children become columns.
.selector{
Display: flex;
Images
unlike regular images, background images are not content, they are decoration.
.selector{
Background-image: url(“image_location/filename.jpg”);