Web Designing 101 Class


#121

Okay. I will check it out. Thank you!


#122

Excellent work @Anelaw,

Now, adjust the font size to 300% on I am Cute and let it align to the right.

Hint:

<p style="font-size:160%;">This is a paragraph.</p>
<p style="text-align:center;">Centered paragraph.</p>


#123


#124

Awesome. You are now a web designer. ets do some more complicated stuff :slight_smile: evil laugh


#125

:disappointed_relieved::disappointed_relieved:


#126

HTML Styles - CSS

Cascading Style Sheet - CSS is used to style an HTML page. So it’a another language we will use to add more beauty to our web page.

We will touch briefly on it before moving on to making real websites.


#127

CSS describes how HTML elements are to be displayed on screen, paper, or in other media.

CSS saves a lot of work. It can control the layout of multiple web pages all at once.

CSS can be added to HTML elements in 3 ways:

Inline - by using the style attribute in HTML elements
Internal - by using a <style> element in the <head> section
External - by using an external CSS file

The most common way to add CSS, is to keep the styles in separate CSS files. However, here we will use inline and internal styling, because this is easier to demonstrate, and easier for you to try it yourself.


#128

Now let us examine these 3 methods.


#129

Inline CSS

An inline CSS is used to apply a unique style to a single HTML element.

An inline CSS uses the style attribute of an HTML element.

This example sets the text color of the<h1> element to blue:

<h1 style="color:blue;">This is a Blue Heading</h1>


#130

Internal CSS

An internal CSS is used to define a style for a single HTML page.

An internal CSS is defined in the section of an HTML page, within a element:

 <!DOCTYPE html>
<html>
<head>
<style>
body {background-color: powderblue;}
h1   {color: blue;}
p    {color: red;}
</style>
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

#131

External CSS

An external style sheet is used to define the style for many HTML pages.

With an external style sheet, you can change the look of an entire web site, by changing one file!

To use an external style sheet, add a link to it in the <head> section of the HTML page:

 <!DOCTYPE html>
<html>
<head>
  <link rel="stylesheet" href="styles.css">
</head>
<body>

<h1>This is a heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

#132

@Anelaw, remember that folder we created in the last class called ‘css’.

Open it, and create a new text file and call it “mycss.css”


#133

Using mycss.css, we shall style the elements on our webpage then import the file on our html file.


#134

Is it safe to conclude that we were using the internal CSS format previously?


#135

Done!


#136

Yes we were. I was about to mention that. You catch on quick. You should consider this as a career dear :slight_smile: I’m serious, I think you have good taste and will definitely be a good web designer.


#137

Aww. Thanks dear. You are a great instructor.
As per career… We will see…


#138

Awesome.

Now open mycss.css and paste the code below :point_down:t6::point_down:t6:

body {
    background-color: powderblue;
}
h1 {
    color: blue;
}
p {
    color: red;
}

Next, create a new html file and name is anything.htm then add the line below to your <head> tag

<link rel="stylesheet" href="<path-to-your-css-file">


#139

Please is this correct?


#140

No. You add that link statement to your htm code not css.