How to work Cascading Style Sheets (CSS)
Platform for Cascading Style Sheet (CSS)
Cascading Style Sheet, or more commonly referred to as CSS, is one of the website documents that aims to set the website style.
CSS Anatomy
The main parts of a CSS consist of three parts, namely: selector, property, value
How CSS works
The way CSS works starts when the desired style declaration is by writing style (selector, id and class), then the style will automatically work on the HTML document. Style definitions can be done in the <style> tag. In these tag pairs, the definition of style is done with the form Selector {...}
Class and ID
Class = defines a class that can apply to any HTML tag. The shape:. Names {...}
ID = defines the style for elements that have the ID corresponding to those listed in the selector. Shape: #id {...}
Inline Style sheet
CSS is defined directly in the HTML tag in question. The method of writing is enough by adding the style = "..." attribute in the HTML tag.
Embedded Style sheet
CSS is defined first in the <style> ... </ style> tag above the <body> tag, more precisely in the <head> tag. Examples like those in the example class and id
External Style sheet
CSS is defined separately on different files. And then the file or web page that wants to apply the style to the CSS file just calls the CSS file
Make a web page as follows
Save with the name "class and id.html" The above example also includes embedded style sheets
Make a web page as follows
Save the file as inline.html. The result
First create a file to make the desired style. For example as follows
Save with the name style.css. Then create an html file that uses that style
Save as external.html The result
Cascading Style Sheet, or more commonly referred to as CSS, is one of the website documents that aims to set the website style.
CSS Anatomy
How CSS works
The way CSS works starts when the desired style declaration is by writing style (selector, id and class), then the style will automatically work on the HTML document. Style definitions can be done in the <style> tag. In these tag pairs, the definition of style is done with the form Selector {...}
Class and ID
Class = defines a class that can apply to any HTML tag. The shape:. Names {...}
ID = defines the style for elements that have the ID corresponding to those listed in the selector. Shape: #id {...}
Inline Style sheet
Embedded Style sheet
CSS is defined first in the <style> ... </ style> tag above the <body> tag, more precisely in the <head> tag. Examples like those in the example class and id
External Style sheet
CSS is defined separately on different files. And then the file or web page that wants to apply the style to the CSS file just calls the CSS file
Make a web page as follows
Save with the name "class and id.html" The above example also includes embedded style sheets
Make a web page as follows
Save the file as inline.html. The result
First create a file to make the desired style. For example as follows
Save with the name style.css. Then create an html file that uses that style
Save as external.html The result








0 Response to "How to work Cascading Style Sheets (CSS)"
Post a Comment