02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

Getting Stylish with CSS: The Style Tag

Until now we worked only with pure HTML in this session we will take our first step into the world of styles. For that we will take a small break from pure HTML and start exploring the world of CSS. You will get out of it the basic skills you need to know about CSS and styling in general. Let's get started.

Video Transcript

00:00Alright, so until now we worked with pure HTML
00:03We talked briefly about CSS which was for styling
00:06and we talked briefly about javascript which is for coding
00:09this course is not going to go deep into the world of styles
00:13but we do need to know a little bit of it
00:15to be able to continue on with our HTML training.
00:19So for that we are going to take a little break from learning HTML
00:22and explore a bit the world of CSS
00:25Now, by no any means,
00:26this course is going to be abolute about CSS
00:29you're really just going to get the basics that you need
00:31to start working with it
00:33But I do encourage you to follow us at
00:3402geek.com
00:36and join many of our other titles
00:37including titles that will be dedicated for CSS totally
00:42Alright, so I created a short paragraph
00:45I have a <h1&gt; Be stylish geeks! </h&gt;
00:47and some copy:
00:48Being a geek doesn't mean you can get fat, not shave, sleep in late
00:52and look down at other non-geeks. Or does it? :)
00:56Yes, the dream is true you can be a geek that isn't stylish
01:00but then again it's fun to be hip and cool like me,
01:03- Right ma? - Right, right
01:05Mmhhmm so let's get stylish
01:08No, I'm kidding. So let's go right into the HTML
01:11we got our premise, we got our point,
01:13we want to start styling things up.
01:15- 'Cause it looks dull - It does... It is dull,
01:17anyway, you can talk hip but that's just not hip.
01:21So let's hip it up
01:24Alright.. so styling up
01:26really where we're going to put our styles is going to be in our <head&gt;
01:29now the way we put style or CSS in HTML5
01:32is just by writing the word <style&gt;
01:35it will work also in HTML earlier versions
01:37so we're not going to even talk about how it was done in history in this course
01:41but if you do it this way it should work
01:43in every single modern browser out there
01:46so, by putting the word <style&gt;, that's all we had to do
01:48and now we can start styling and in between this new tag of <style&gt;
01:52we're going to put inside all of our CSS which is a completely different language
01:57that is communicative with HTML
02:00so it's a language that knows how to talk with HTML
02:03but is just not HTML
02:05Alright, so the first thing that we're going to learn is that
02:07to be able to do a style or to be able to change a color
02:10E.g: we wanted to change the background of our HTML page
02:14from being white to being grey
02:16the way we would do that,
02:18we would approach the different elements in HTML
02:20and then tell them what we want them to do
02:23so in this case we want to go to our <body&gt;
02:25so i'm going to go to my <body&gt; and in to my <body&gt;
02:28I want to give a list of instructions. Now to give a list of instructions
02:31I'll always open a curly bracket and close a curly bracket "{}"
02:35now any instruction that I want to give to my <body&gt;
02:37which is basically our <body&gt; HTML element
02:40I would put inside of this wrapped around curly brackets
02:44Alright , so what I want to tell it is
02:45I want to tell it that I want to change the background
02:47and literally that's all I had to write "background" and then a colon -":"
02:51and then I would write the actual value.
02:53now I could write the value in text, I could actually write "red"
02:56and if I write red and I go into my application
02:59into the browser itself and click on refresh
03:01my background would turn red
03:04Now , there's a limit of how many colors you can actually say in text
03:08there's not that many of them
03:10but the reality is that the computer programmers
03:13have so much different color variations it's already in the millions
03:17now the best way to represent colors in a computer
03:20is through a combination of three colors
03:22Red, Green and Blue as you've probably heard the term "RGB"
03:26which you find that also on TV screens, and LCDs and so on and so forth
03:31RGB is basically Red, Green and Blue
03:34so basically says the television is capable of turning on lights
03:38that are red, green and blue and mixing those lights together
03:41and the same is true with programming
03:43now this combination of different color variations
03:46enables you to create millions of variations of colors
03:50the way you would do that and add those millions of variations of colors is
03:54instead of putting the actual value "Red" you would put inside here the... ,
03:58-number? - <hash&gt; tag or a <number&gt; tag?
04:00I think it's the same, <hash&gt; tag right?
04:02<number&gt; tag and then you'd put numbers
04:05now the numbers you would put inside, the first two digits would represent red
04:10the next two digits would represent green,
04:13the next two digits would represent blue
04:15So it's RGB
04:17Now, I'm not going to go into the theory of numbers
04:20the values that can go inside of this red area are between 0 and 255
04:26now, you might ask me
04:28"Ben, but there's only two digits there," right ma?
04:31"How could I put inside 255 values in such a small space?"
04:35well , the answer is simple
04:38you might not notice because you're probably a designer
04:41or someone that is coming from marketing: There's a lot of ..
04:44If you know mathematics or you're a programmer
04:47-Laughing from the kitchen -The kitchen?
04:49Or you're from the kitchen. Right. Exactly. Legitimate place to come from.
04:55well, there's a lot of different number types
04:57and actually us, humans, for some reason
05:00stuck to numbers that have 10 digits
05:03because we have 10 fingers
05:04contrary to that, babies, by the way,
05:07have a better relationship with numbers that have only two values: 0 and 1
05:12Surprisingly enough, if you've given a kid to interact
05:16with stuff that are connected to 0 and 1
05:18they would feel at home and very comfortable with it.
05:21Same is true with computers
05:22computers work off of "0101" so if you ever watch the movie "The Matrix"
05:26that's why you saw a lot of "0101" all over
05:29it was kind of like a play on that idea
05:32that the whole world is just numbers that are based off of "01"
05:36now obviously, could you represent "10" with "01"
05:40No
05:41in a case for example, I'm just going to, just for the sake open this up for 1 sec.
05:45"0" let's say represents Zero If that's the only digit
05:49and "1" represents one, right? now this (10) would represent 3
05:54because there's just no more room left in the digit area
05:56and this (11) would represent 4 and this (100) would represent 5
06:01this (101) would represent 6 and this (111) would represent 7
06:05and so on and so forth so the capabilities
06:08enable us to basically create a language, the numeric system,
06:12would just be based on "01" They're languages
06:14they're numeric representations of numbers in the powers of 2
06:19which is the "01" or they're called Boolean numbering systems
06:24there's numbers that are based on "3" on "4" on "5" on "6"
06:27and so on and so forth
06:29now , the way we represent color using RGB is using Hexadecimal code
06:36a hexadecimal which basically stands for "16"
06:38basically , our position of our numbers could start from "0"...
06:42and it could grow from "0"
06:43and it could go from "0" to "1" to "2" to "3" to "4" to "5" to "6" to "7" to "8" to "9"
06:49but it's not over there, once we get to "9" we move on
06:52to the digit "A" and then "B" and then "C" and then "D" and then "E" and then "F"
06:58all the way through
07:00so although it's not visually logical
07:02and it's probably hard to comprehend it on a..
07:04like if I give you a number and I tell you This (F3) What number is that?
07:08you could calculate it but it would be really rough
07:10the calculation would be that "F" would probably stand for 16
07:14and you would.. well actually,
07:18the "F", if it was only "F" alone it would stand for 16
07:21but as soon as the F is on this side it actually would stand for "16 times 16"
07:26really because 16 on this side is already in the 10's digits,
07:30complicated stuff, right?
07:32but you don't have to worry about it too much
07:34all you have to worry about is that
07:36you have the value of "00" which is no color
07:38and all the way until FF which is equivalent of the value of 255
07:44and you can play with any range of numbers
07:46from a number which would be lower such as maybe 66
07:50till a number that would be really high such as EE
07:54and the more you play with it, the more you'll discover different colours
07:56now one way around it
07:57without you needing to memorise these type of colors
08:00is using some applications such as if you would find in Firefox
08:04there's an application that enables you to color code images.
08:07I'm going to pause this for a second and take you into Photoshop
08:09if you're working with a professional editor tool
08:12you could actually fetch numbers without needing to memorise them

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!