Chapter 6:

Style Tag:
  • 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
    1. dotted
    2. doubled
    3. dashed
    4. inset
    5. outset
    6. none
    7. 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
    1. border-top-color
    2. border-left-color
    3. border-right-color
    4. 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: