tailieunhanh - Học JavaScript qua ví dụ part 62

Các loại Style Sheets Có nhiều cách để xác định phong cách trang trong một tài liệu: 1. Embedded kiểu được định nghĩa trong thẻ cho tài liệu HTML. 2. Inline-phong cách được định nghĩa cho một phần tử HTML cụ thể. 3. Bên ngoài theo phong cách được định nghĩa trong một tập tin bên ngoài. | 550 Chapter 14 Introduction to CSS Cascading Style Sheets with JavaScript Types of Style Sheets There are several ways to define style sheets within a document 1. Embedded The style is defined within the style tags for the HTML document. 2. Inline The style is defined for a specific HTML element. 3. External The style is defined in an external file. The Embedded Style Sheet and the style Tag A style sheet that is created with the HTML style style tags right in the current document is called an embedded style sheet. The style Tag. The style style tags were introduced into HTML to allow the style sheets to be inserted right into an HTML document. They are used to create a set of rules to define the style of an HTML element s . The style style tags are placed between the head head tags in the document as shown here html title CSS Example title head style hl color blue style head The type Attribute. Because it is possible to have more than one style sheet language you can tell the browser what type of style sheet you are using with the type attribute of the HTML style tag. When the browser loads the page it will ignore the style sheet if it doesn t recognize the language otherwise it will read the style sheet. The following example specifies that the type is text css that is text and CSS. FORMAT style type style sheet language Example style type text css From the Library of Types of Style Sheets 551 EXAMPLE 1 2 3 4 5 6 7 8 9 10 11 html head title Cascading Style Sheets title style ty e text css --body background-color lightblue p background yellow text-indent 5 margin-left 20 margin-right 20 border-width 10px border-style groove padding 15px font-family times arial font-size 150 font-weight 900 hl h2 h3 text-align center background blue border-width 5px border-style solid border-color black margin-left 20 margin-right 20 font-family courier arial font-weight 900 color white h2 h3 font-size 24 em color green font-weight bold -- style .

TỪ KHÓA LIÊN QUAN