HTML CSS

one. Basic introduction to CSS

Cascading Style Sheet (Cascading Style Sheet) is referred to as "CSS", usually also known as "Style Sheet (Style Sheet)", which is used to style web pages. Designed. For example, if you want the link word to be blue when it is not clicked, and then turn red and underlined when the mouse is moved over it, this is a style. By setting up a style sheet, you can uniformly control the display attributes of each mark in HTML. Cascading style sheets allow people to more effectively control the appearance of web pages. Using cascading style sheets, you can expand your ability to precisely specify the position and appearance of web page elements and create special effects.

CSS is the abbreviation of English CascadingStyle Sheets (Cascading Style Sheets). It is a computer language used to express file styles such as HTML or XML. The latest version of CSS is CSS3, which is a style design language that can truly separate web page performance and content. Compared with the performance of traditional HTML, CSS can perform pixel-level precise control over the position and layout of objects in web pages, supports almost all font sizes and styles, has the ability to edit web page objects and model styles, and can perform preliminary interactions. Design is currently the best expressive design language based on text display. CSS can simplify or optimize writing methods according to the understanding ability of different users, making it highly readable for all types of people.

two. How to use CSS

There are three ways to use style sheets on your site pages:

Inline styles - used in HTML elements" style" attribute


Internal style sheet - Use the

Use inline styles to apply cascading style sheet attributes to web page elements. For example:

CSS document





If the web page links to an external style sheet, inline or internal styles created for the web page will extend or override the specified attributes in the external style sheet.

To use styles from an external style sheet on a web page, link the web page to the style sheet by using the Style Sheet Link command on the Format menu. You can link one or several style sheets to the current web page in Web page view mode, to a selected web page in a folder list, or to all web pages on the site.

The Style box lists standard HTML tags, such as heading 1, as well as class or ID selectors contained in embedded style sheets or external style sheets linked to the web page. To apply a style to a web page element, select the style and click the style or selector in the Style box.

In Microsoft FrontPage 2000, certain formatting properties are automatically applied as inline styles. For example: If you use the Borders & Shadows command (on the Format menu) to apply a box around a regular paragraph, FrontPage writes the formatting information as the paragraph mark's inline style properties (for example: ). However, the application of some properties requires the use of CSS, and others requires the use of HTML. If people only want to apply inline styles using CSS, they can use the Styles button (located in the Web element's Properties dialog box) to apply class or ID selectors or inline styles.

Example 1

Background-color attribute defines the background color of an element:

    php中文网(php.cn) 

标题

内容

Example 2

##Use font-family (font), color (color), and font-size (font size) ) attribute to define the font style:

    php中文网(php.cn) 

文字的标题

下面是一句话。

Example 3

Use the text-align (text alignment) attribute to specify the horizontal and vertical text Alignment:

    php中文网(php.cn) 

居中对齐的标题

这是一个段落。



Continuing Learning
||
php中文网(php.cn)

标题

居中对齐的内容

下面是一句话。

submit Reset Code
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!