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: README.md
+36Lines changed: 36 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1032,6 +1032,8 @@ Duh.
1032
1032
1033
1033
Let's just say you want to reuse your styles across your website on every page. It makes sense. It'd be kind of annoying to have drastic changes on every page.
1034
1034
1035
+
####The `<link>` tag
1036
+
1035
1037
That's where the `<link>` tag comes in! The `<link>` tag is an empty tag (like <br> and <img>), so it has no end tag, and it's used to link to external stylesheets!
1036
1038
1037
1039
What the heck is an external stylesheet? Well, put simply, it's CSS, in its own file.
@@ -1047,6 +1049,40 @@ And finally, `href`. You remember this one, I hope! It's just like our `<a>` t
1047
1049
Let's check out this `<link>` tag in action. Open up the Linking folder and open home.html, and paste the `<link>` line above on the line below the `<title>` tags in the `<head>`. Voila! That's it. Refresh your browser and check out the magic. It should look just like what we made in the previous section!
1048
1050
Now, if you open the main.css file in your editor, you'll see that it's all the CSS you recognize and love, but there's no `<style>` tags. Those tags aren't needed when you are using a CSS file!
1049
1051
1052
+
####Commenting
1053
+
1054
+
Let's just say that you want to show off your code to someone, but they're not exactly sure what you're doing.
1055
+
1056
+
You can add comments!
1057
+
1058
+
*Comments* in your code are blocks of text that will not be read by the computer. Every computer language has them.
1059
+
1060
+
#####HTML Comments
1061
+
1062
+
In HTML, a comment looks like this:
1063
+
1064
+
<!-- This is an HTML comment! -->
1065
+
1066
+
As you can see, it almost looks like a regular tag, with an opening `<!--` and an ending `-->`. You can put this pretty much anywhere in your HTML files and it won't affect your work!
1067
+
1068
+
Look inside the Project folder, and open index.html. You'll see a few comments there. Notice how you can put them all on one line, or in a multi-line block! As long as you have a beginning `<!--` and end `-->`, you have total freedom with comments.
1069
+
1070
+
#####CSS Comments
1071
+
1072
+
Don't worry, you can comment your CSS too!
1073
+
1074
+
A comment in CSS is similar to HTML in that it has a beginning and end part, but it looks a little different:
1075
+
1076
+
/* This is a comment in CSS! */
1077
+
1078
+
Just like in the HTML comments, you have a beginning `/*` and an end `*/`. If you open up main.css in the Project folder, you can see the comments I wrote in there! And again, you can have single-line comments, and multi-line ones too.
1079
+
1080
+
Comments are great for keeping track of what you're doing, especially if a project you're working on spans over a period of time. YOu can make notes for yourself to check later, or you could just tell someone who is reading your code that they are attractive.
1081
+
1082
+
####Other Developer Joys
1083
+
1084
+
There's so many things that could go in this section for such a generic title.
1085
+
1050
1086
Psh like I'm going to write this before I eat another cookie. Break time.
0 commit comments