Chapter 6:
Style Tag:


Output:

CSS ID:
Border Colors:
Output:

- Style tag is used to write style information for the html document.
- Specified in head section.
- When we write internal css,style tag will be used.
- Following example is based on tag name.
Code:
Output:
CSS ID:
- Id is unique to every html element.
- Id value is used in css to apply styles.
- # symbol represents id.
CSS Class:
- Class attribute is not unique.
- We can give same class name to different html elements.
- Same styles applied to elements with same name.
- (.) symbol represents class.
Code:
Output:
Text boxes With Borders:
- we can give different borders to text boxes with css.
- Border-style property specifies kind of border.
- This property have values like
- dotted
- doubled
- dashed
- inset
- outset
- none
- hidden
- we can specify in border property also like border: 1px dotted red.
Code:
Output:
Border Colors:
- Border-color property is used to set color of input element.
- If we want to specify color to particular side then we have to use any of following
- border-top-color
- border-left-color
- border-right-color
- border-bottom-color
- Syntax: border-color: top-color bottom-color right-color left-color.
Code:
Syntax:
- I applied border color to top border and bottom border of the text box.
Code:
Output:
Background Colors:
- In input elements,we can apply background colors to text field and text area.
- By using background-color property.
- Syntax: background-color: value (color code).
Code:
Output: