CSS Beginner's Guide

Source: Internet
Author: User

The content comes from HTML dog.

The format of CSS is 'property:value'

There are three ways to insert CSS styles into HTML: inline, internal CSS, external CSS files, as follows:

<style= "color:red">text</p>
<!DOCTYPE HTML><HTML><Head><title>CSS Example</title><style>P{Color:Red;    }a{Color:Blue;    }</style>...
<! DOCTYPE HTML > < HTML > < Head >    < title > My First Web page</title>    <link rel= "stylesheet" href= "Style.css" ></head>...

CSS to set the style of HTML, first must first get the HTML element selector,

The simplest selector is to use the HTML element name directly, as shown below

Units of measure in CSS:

Colors in CSS:

There are two representations, and some predefined colors, and CSS3 has some advanced settings.

Text in CSS

Different computers have different fonts, and sometimes the fonts you set are not valid on other computers.

But there are also some safe fonts, such as: Arial,verdana, Times New Roman, etc.

The insurance method is to set multiple fonts (separated by commas), so that the browser can not find the first font in the case of the search for a second font, go down

Note that if the font is more than one word, you should put it in double quotes, such as font-family: "Times New Roman" .

Here are a few font-related CSS properties:

Add: Font-size is to modify the text size, a variety of dashes are text-decoration, in the overall style there are some of the following

But I don't think it will be used often.

CSS Beginner's Guide

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.