BDWS-Task4: Introduction to CSS

1. General: CSS is Cascading Style Sheet that define appearance and format of HTML.
2. Why we need CSS file:
· In order to define a form that apply to many other HTML elements without formatting each elements by coding.
· It’s possible to apply format and appearance to several HTML sites by a single CSS file.
3. There are 2 ways to define a format:
· In-Line CSS: a format created in-line along with HTML Tags. It’s only valid for one place it stored: Use type attribute.
· Use <style> </style> tag: as usual, this tag should be declared in HTML’s head part.
· CSS File: by creating a link reference to CSS file, HTML will use the format that CSS file defined, declared.
4. CSS File Syntax: 3 basic parts:
· Selectors: HTML elements. There are many ways to format a selector, each ways/aspect called property.
· div.
· p.
· a.
· …
· Property: HTML element’s parts that will be affected.
· background-color.
· color.
· height.
· width.
· border.
· position.
· shaping.
·
· ….
· Value: A new value applied to CSS’s property for changing format of HTML Elements. In order to separate property value, it’s important to put an semicolon at the end of formatted line.
· Color: hexa or text types.
· Size: pixels
· Font-size: pixels and em.
· Font-family: fontname : to define font type of text.
· Backup Value: separated with main value by comma;
5. CSS Comment: The comment should be add to describe the meaning of formatting form.
Nhận xét
Đăng nhận xét