CSS

If you want to make your web page beautiful, you must know CSS. CSS is a language that allows you to describe your web pages, color your texts, change the font of the text, and modify the layout of the web page.

There are two parts of a CSS syntax:

  • Selector
  • Decorator

Before proceeding with learning CSS, you need to introduce yourself with an HTML tag:

<style>

</style>

This tag should be kept between the <head></head> tags. Therefore, the structure of the code will be as shown in the following:

<html>
  <head>
    <title>
    </title>
    <style>
      // your codes will be typed here
    </style>
  </head>
  <body>
  </body>
</html>

The CSS codes will be written in between the <style></style> tags.

To format your text, you need to remember the tag that you used for the text. Consider that you have a text in the <h1></h1> tag in the body of the HTML document, as follows:

<h1> This is an example of HTML text. </h1>

To apply CSS, you need to type the following between the <style> </style> tags:

<html>
  <head>
    <title>
    </title>
    <style>
      h1 {
      color:green;
      text-decoration: underline;
      text-align: center;
      }
    </style>
  </head>
  <body>
    <h1>This is an example of HTML text </h1>
  </body>
</html>

The output of the code will be as follows:

CSS

Look at the code carefully. We used the following CSS for the text in the <h1></h1> tags:

      h1 {
      color:green;
      text-decoration: underline;
      text-align: center;
      }

Here, we used a few CSS syntaxes (color, text-decoration, and so on). There are a number of CSS syntaxes, also called property (and every property may contain more than one value).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.108.54