Video Transcript:
Hi this is Ashton Sanders with CSS Videos.com, and we are going to be talking about CSS Syntax.
My favorite thing about CSS is that it has a very simple syntax; making it super easy to learn.
In Cascading Style Sheets, you are writing a series of rules to apply to your HTML document. Every rule has these things:
- Selector: is the hook used to choose what part(s) of your HTML to apply the CSS to. Following the selector is the…
- Declaration Block: Everything within the curly brackets, “{” and “}”, is called the declaration block
- Declaration: Inside a declaration block you can have as many declarations as you want and each declaration is a combination of a CSS Property and a value.
- Property: is one of the CSS Properties used to tell what part of the selector will be changed (or styled).
- Value: assigns a value to the property.
(Note that the Property is always followed by a colon, and each declaration is separated with a semicolon
Here are some quick sample:
Let’s Say that title at the top of this video screen is an H1 element. The HTML code for that would look like this:
<h1>CSS Syntax</h1>
Now lets use CSS to make it red.
h1 { color: red }
This bit of code tells the h1 to have the color of red. Boo yea, we got some red in there and we are good to go.
Let’s add another declaration to the declaration block to make the background color black:
h1 { color: red; background: black; }
You now know the basics of the CSS Syntax.
My next video will go into further detail about the CSS Selector, and some things you should know about it.
Thanks for Watching!
Ashton Sanders
CSSVideos.com
great video!
Nice – can’t wait for the next vid!
[…] CSS Syntax […]
work of an eagle scout
Ashton.
Do you need to know HTML to create CSS? I’m following along but I don’t have any experience with HTML besides the basic ‘b’ and ‘/b’ commands etc.
On that note, is CSS created in a program or do you just imput it manually?
Hi Alicia,
I responded via email, but to summarize: Yes, you should know the foundations of HTML since CSS is used to style the HTML of your webpage.
Hi,
Very easy to understand explanation of
css syntax. Thanks
Jean
Hi, good videos, but the sound settings almost blew my eardrums!! Check out the sound levels on your first video and the one above, and CHANGE it.
Damn, my head’s hurting…. (I wore earplugs)
Haha, really? Yea, the sound on the first one is way too quite, so I’ve increased them. I’ll try to fix that first one.
Talk soon,
Ashton
Excellent videos!
Thanks for sharing.
Irina
THxxx for the mimportants vidéoooss !!
Great videos. Can I know what video software you used to record the videos?
Thank You
You Rock Ashton!
Thanks for the vid tut
Great post, My bookmarked your own weblog so we could the a lot more upon, Take care
Hi ashton. Excellent tutorials! Now I can complete my PHP website. Few more days to go and I can now post my site. Tnx much dude!
Excellent tutorials! Now I can complete my PHP website. Few more days to go and I can now post my site. Tnx much dude!
Great little vid on the basics of css. Once you got the basics then you can get styling
am not getting proper o/p if i use this css syntax
Great video on the basics of css. I cant ask more than this. well done mate.
thanx man for this video i love css ..
[…] View Tutorial […]