Html CSS-Style:
Example:
Html Styling with CSS:
Css stands for Cascading Style Sheets.In 3 ways styling can be added to Html:
1)Using style attribute - INLINE
2)Using <style> element in Html <head> section - Internal
3)Using one or more external Css files - EXTERNAL
Common way to add styling is to keep style in seperate Css files.
Syntax of Css:
Syntax of Css styling are as follows:Elements is an Html element name.Property is Css property.Value is Css value.
Semicolon are used to seperate multiple styles.
Inline Styling or Inline Css:
Inline styling used for applying unique style to single Html element:Inline styling also uses style attribute.
Inline styling changes text colour of single heading.
Example:
Internal Styling Or Internal Css:
Internal styling sheet is used to define common style for Html elements on page.In <head> section internal styling is defined on an html page by using <style. element.
Example:
External Css or External Styling:
By using external style sheets you can change look of your web site by changing only one file.External styles are defined in external Css file and then linked in <head> section of Html page.
Example:
Fonts Of Css:
Css colour property defines text colour used for Html element.Css font family defines font used for Html element.
Css font size defines text size for Html element.
Example:
Css Box Model:
Html element has box around it even you can't see it.Css border defines visible border around Html element.
Example:
Css padding defines padding/space inside border.
Example:
Css margin defines margin outside border.
Example:
id Attribute:
To define special style for one special element,you have to hide it to id attribute to element.Example:
After thatdefines different style for identified element.
Example:
Class Attribute:
Style for special type of elements,add class attribute to element.Example:
To define different style for all element with specified class.
No comments:
Post a Comment