You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Intro to HTML and CSS/README.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ In this section we will learn how to create a simple website with HTML and CSS.
24
24
If you'd prefer, you could create a `.html` file of your choice, and double-click it to open it in your web browser, and refresh to view your changes.
25
25
26
26
## HTML Basics
27
-
Every HTML file should begin with `<html>` and end with `</html>`. This defines the file. You will notice that every time we use a tag, which is the thing with the angle brackets we just saw, we need to end it with the same thing preceded by a "`/`".
27
+
Every HTML file should begin with `<html>` and end with `</html>`. This defines the file. You will notice that every time we use a tag, which is the thing with the angle brackets we just saw, we need to end it with the same thing preceded by a "`/`" inside the brackets.
28
28
29
29
The visible portion of an HTML file is between the body tags. Below is an example of this. Don't worry if you see tags that you do not know yet, we will talk about them soon! Another important thing to know is how to write a comment in HTML, this is also indicated below.
30
30
@@ -38,7 +38,7 @@ The visible portion of an HTML file is between the body tags. Below is an exampl
38
38
</html>
39
39
```
40
40
41
-
An**HTML element** is anything between a start tag and an end tag. Elements include headings, paragraphs, breaks, and others. The **heading** (`h1`) element above gives the largest heading size. For smaller headings, try `<h2>`, `<h3>`, `<h6>`. The higher the number, the smaller the heading! The **paragraph** element is self explanatory, you can put a chunk of text here.
41
+
A**HTML element** is anything between a start tag and an end tag. Elements include headings, paragraphs, breaks, and others. The **heading** (`h1`) element above gives the largest heading size. For smaller headings, try `<h2>`, `<h3>`, `<h6>`. The higher the number, the smaller the heading! The **paragraph** element is self explanatory, you can put a chunk of text here.
42
42
43
43
Next let's look at how to **link** things in your HTML file with `<a>` elements. Below is an example. The `href` attribute tells us what website we are linking to. The text that follows will be the text to click to get to that website. By the way, an **attribute** in HTML gives more information about an element.
44
44
@@ -59,7 +59,7 @@ The last HTML element we will look at in depth is the **div** (`<div>`). This ta
59
59
```
60
60
61
61
## CSS Selection (`class` and `id`)
62
-
Now that we have a basic website in the works, we want it to look pretty! You probably do not want your website to be just black text on a white background. In HTML, we can use the `style` attribute of elements to specify how we want them displayed. CSS is an clean way to set the style of your HTML elements from outside of the HTML file. All our CSS work should be contained in another file that ends with "`.css`".
62
+
Now that we have a basic website in the works, we want it to look pretty! You probably do not want your website to be just black text on a white background. In HTML, we can use the `style` attribute of elements to specify how we want them displayed. CSS is a clean way to set the style of your HTML elements from outside of the HTML file. All our CSS work should be contained in another file that ends with "`.css`".
63
63
64
64
Let's pause here to mention a couple more important HTML features. The ```<head>``` element allows us to store data about our HTML code. This might include tags such as ```<title>``` and ```<link>```, which we will talk about soon. The ```<head>``` element is placed between the `<html>` and `<body>` tags. The ```<title>``` tag defines the title of the file and tells the browser what to display for a tab on this page. You can use the ```<link>``` tag to connect your HTML and CSS files. Here is an example of the tags we just mentioned:
65
65
```html
@@ -172,7 +172,7 @@ We can also set **borders** on elements. Like text, you can set the color of a b
172
172
173
173
Now we will take a look at how to position elements on the screen with CSS.
174
174
175
-
First, let's take a look at using **float**. Using float allow you to place an element to the left or to the right. As pictured below (image taken from [this website](https://css-tricks.com/all-about-floats/)):
175
+
First, let's take a look at using **float**. Using float allows you to place an element to the left or to the right. As pictured below (image taken from [this website](https://css-tricks.com/all-about-floats/)):
@@ -195,6 +195,7 @@ Take a look at the difference between using ```float``` and ```inline-block```:
195
195

196
196
197
197
Shoutout to the website that image is from, vanseo desgin! They have more information on using ```float``` vs. ```inline-block```, if you follow [this link](https://vanseodesign.com/css/inline-blocks/)!
198
+
198
199
## Forms
199
200
Forms let users interact with the website, whether it be by entering their information or their vote in a poll or anything of that sort. In HTML we have a handy dandy ```form``` element! This will let us get input from the user.
200
201
@@ -241,9 +242,9 @@ The last input type we will look at is ```checkbox```. As expected, this display
241
242
<labelfor="pet5">Rabbit</label>
242
243
</form>
243
244
```
244
-
This checklist finds out what pets a user owns. It would display similar to the ```radio``` type, but with checkboxes as opposed to buttons.
245
+
This checklist finds out what pets a user owns. It would display something similar to the ```radio``` type, but with checkboxes as opposed to buttons.
245
246
246
-
Now the user has submitted their response to our form... what now? The ```action``` attribute will tell our site where to send the user's data from here. This attribute affects the ```form``` element. So it should be placed within the ```form``` tag, like so:
247
+
Now that the user has submitted their response to our form... what's next? The ```action``` attribute will tell our site where to send the user's data from here. This attribute affects the ```form``` element. So it should be placed within the ```form``` tag, like so:
247
248
```html
248
249
<formaction="/foodDecider.php">
249
250
<labelfor="food">What is your favorite food?</label>
@@ -255,7 +256,7 @@ This form asks a user what their favorite food is and sends the information to t
255
256
This section will be very useful later in this workshop when we take a look at JavaScript and Flask!
256
257
257
258
## Cool CSS Things
258
-
So far we have covered some simple CSS material that will make our HTML file more exciting. We can do even more to make our website look fabulous! Now we will cover fading, rounded corners, and dropdowns. These are only a few of the many possibilities that CSS provides. Feel free to look around online for more options!
259
+
So far we have covered some simple CSS material that will make our HTML file more exciting. We can do even more to make our website look fabulous! Below we will cover fading, rounded corners, and dropdowns. These are only a few of the many possibilities that CSS provides. Feel free to look around online for more options!
0 commit comments