Let's Learn CSS!
CSS is a language used to style web pages that contain HTML elements. It can be used to change the color of text, background color, font size, font style, borders, spacing, height, width, and much more.
CSS can be added to HTML documents in three different ways: inline, internal, and external. Inline CSS is used to apply a unique style to a single HTML element, internal CSS is used to define a unique style for a single HTML page, and external CSS file is used to define the style for many HTML pages. CSS saves a lot of time and work by controlling the layout of multiple web pages all at once.
From the ways mentioned above we can get at the HTML object's style on the page like you learned on the HTML page. HTML objects are given tags and in those tags are attributes that describe the object, some of these attributes that describe the object be used to select it and give it style. See the example below.
p {
color: red;
text-align: center;
}
- Lesson 1
- Easy
- Medium
- Hard
Challenge
Create two css statements below. 1. Create a red font for the title by putting color:red within a css declaration statement. 2. Bold the paragraph using font-weight and then enlarge the paragraph's font size to 18pt by using another css declaration statement.
The css selector for the title is h1 or its id "title"; the css selector for the paragraph is p.
Here is an example of the title: #title { color: red; }
