Launched A Free CSS Course On Scrimba. Eric Tirado Intro To HTML Course
Launched A Free CSS Course On Scrimba. Eric Tirado Intro To HTML Course
of the web, along with HTML and JavaScript. It’s what brings life
to websites through colours, styling, positioning and much
more. Thus, knowing CSS is hugely valuable in today’s labour
market!
CSS Vocabulary
So, for example, this is an h1 element. It has some default
styling which appears when you render it in the browser. If we
want to change some styling, we can use CSS:
h1 {
color: 'red';
}
The selector for our h1 element is simply the name of the
element itself, and then we assign it the property of color with
the value of red. In the same way, we can select elements using
Classes and IDs as well, which is discussed in later videos.
Part #4: Classes and IDs
This part of the course discusses how to use classes and IDs in
CSS to select HTML elements and apply different styling on
them. It also discusses in detail the difference between Class
and ID, and how and when we assign them on HTML elements
.heading {
color: blue
}
#paragraph {
color: green;
font-size: 14px;
}
.heading {
color: green;
}
Using CSS, we assign the colour of blue to h1 tag which will
change the colour of every h1 . We also then assign the colour
of green to class heading, so that every element with this class
will have its colour overridden to green. So the h1 tag we
defined above will appear as green.
Part #6: Width & Height
In this lesson, you’ll learn how to apply width and height in order
to control the formatting and flow of the page.
Above is a slide from the lesson, which will give you an idea of
how we can create sections and boxes using width and height
to make our web page look properly formatted.
1. Absolute Units
2. Relative Units.
Absolute units are fixed length units, and a length which is
expressed in any of them will appear as exactly that size. For
example, cm, mm, in, 'px, and so on are absolute units.
On the other hand, relative length units specify a length relative
to another length property. For example, em, ex, rem, and so on
are absolute units.
Part #8: Colors
This lesson discusses in detail how we can use and apply
colours to different HTML elements. It also discusses different
ways we can declare the name of the colour in our CSS
properties.
.heading1 {
color: orange;
}
.heading2 {
color: #ff6347;
}
.heading3 {
color: RGB(255, 99, 71);
}
The example above has three classes declared with the same
property of colour assigned to them. But the point to notice is
how we have used different ways to assign the values of
colours.
.container {
padding: 10px;
/* padding-left: 10px; */
/* padding-right: 10px; */
/* padding-top: 5px; */
/* padding-bottom: 5px; */
}
Like in the example above, we can either just use the property
of padding, which will apply the spacing to all the sides, or
alternatively, you can give padding to individual directions.
Part #10: Borders
In this lesson, you will learn how you can apply borders around
your content. You’ll also learn about the variations you can give
to the borders using different styles and options available in
CSS.
Take the example of the box in the above picture and notice the
borders around it with different colours and width.
.container {
margin: 10px;
/* margin-left: 10px; */
/* margin-right: 10px; */
/* margin-top: 5px; */
/* margin-bottom: 5px; */
}
Inline elements can not take the width and height properties.
They will always be as big as their content. However, on block
elements, you can set both width and height as you like
Part #16: Float & Clear
In the lesson, you’ll be learning about
the float and clear properties. These are very useful if we want
to control the position of HTML elements to float left or right of
each other.
Part #17: Float Layout Challenge
Here comes the challenge of this course. In it, you’ll be
encouraged to create the following layout using
the float properties. Later in the screencast, Eric will teach you
how to do it in case you faced any difficulties.
Part #18: Position Property
In this lesson, we’ll design a simple article page where we’re
using the available positioning properties. We will be working
with divs, text content, span, and footer.
/* unvisited link */
a:link {
color: aqua;
}
/* visited link */
a:visited {
color: orange;
}
For example, in the above code snippet, we are applying
different classes to the anchor tag using its state of whether it
has been visited or not. There are thousands of use cases for
using pseudo-classes, and this lesson will help you understand
the basic concept of using them.
CSS is a vast topic, and they are many more features to learn
apart from what was covered during this course!