May be you already heard about CSS. CSS stands for the Cascading Style Sheet. Css is a collection of formatting rules that control the appearance of content in a web page.
HTML is used to structure content. CSS is used for formatting structured content.
( In simple word css allow you to change style of fonts, colors, background, borders, text formatting, link etc.)
There are three ways you can apply CSS to an HTML document
- Inline
- Embedded
- External Style Sheets
Inline Styles: Inline styles are styles that are written directly in the tag on the HTML document. Inline styles affect only the tag they are applied to.
< a href=" " style="color: red;" >
Embedded Styles: Embedded styles are styles that are embedded in the head of the HTML document. Embedded styles affect only the tags on the page they are embedded in.
< style type="text/css">
p {border-left: 1px dotted gray;}< /style>
If any changes you want to make to one page, will have to be made to all. This method can be good if you need to style only one page.
External Styles: External styles are styles that are written in a separate document and then attached to various HTML documents. External style sheets can affect any page they are attached to.
< link rel="stylesheet" type="text/css" href="styles.css" />
- Can control styles for multiple documents at once.
- Easier Maintenance
- Reduced File Size
- Improved Flexibility
1 comments:
Simple and straight forward, this will be useful for those who are just started studying CSS and HTML. Keep it up!
-richard
Post a Comment