In Association with Amazon.in   Flipkart

Friday, July 5, 2013

CSS Examples With Class Formating Styles

Example-1:

<html>
  <head>
         <style>
               .abc{
                   
                    border         : 1 solid blue;
                    width          :150;
                    height         :150;
                   
                    }
         </style>
  </head>
  <body>
         <p class="abc">  Welcome to Css      </p>
        
  </body>
</html>


Example-2

<html>
  <head>
         <style>
               .abc{
                   
                    border      :1 solid blue;
                    width       :1000;
                    height      :1000;
                    background  :url(winter.jpg);
                    background  :red;
                    background-color :blue;
                    background-image :url(msslogo.jpg);
                    background-repeat:no-repeat;
                                                         (repeat-x , repeat-y )
                    background-position:left top;
                                                         right bottom
                                                            center center
                    }
         </style>
  </head>
  <body>
         <p class="abc">  Welcome to CSS     </p>        
  </body>
</html>

CSS Styles For FONT, Background, Box Formating Styles

Font Attributes

  •     Font-size
  •     Font-weight  Bold ( 100  -  1000 )
  •     Font-family    (Arial , courier , Times New Roman )

Text Attributes

  •     Text-align 
  •     Word-spacing
  •     Letter-spacing
  •     Color
  •     Text-decoration (underline, overline,line-through,none)
  •     Text-height

Background

  •     Background
  •     Background-color
  •     Background-image
  •     Background-repeat
  •     Background-position

Box

  •     Width
  •     Height
  •     Border
  •     Margin
  •     Padding
  •     Position
  •     Top
  •     Bottom
  •     Left
  •     Right
  •     Z-index
  •     Float


Example-1:

<html>
  <head>
         <style>
               .abc{
                    font-size      :20;
                    border         : 1 solid blue;
                    word-spacing   :2em;
                    letter-spacing :2em;
                    Text-decoration:underline;
                                                  (overline,line-through,none)
                    color          :red;
                    text-align     :right;
                                            (left , center)
                    line-height    :20;
                    }
         </style>
  </head>
  <body>
         <p class="abc">  Welcome to Css      </p>
        
  </body>
</html>

CSS Styles Through DIV Tag With Example

<div> (Line break) : This Tag is used to group a set of objects and apply styles to entire group.

Example-3:  <div>  Using inline CSS     (it  will start from next line)


<html>
        <head>
               
        </head>
        <body>  
<div id="header">
             <hr/>
            <h2>  Designed by: <div style="color:red">Ganesh M</div></h2>
           <hr/>
</div>
        </body>
</html>
o/p:-------------------------------------------------------------
_______________________________
Designed by:
 Ganesh M

_______________________________

CSS Styles Through SPAN Tag With Example

<span> (same line) This tag don’t have any attributes. With out line brake we can apply styles to certain portion of text.

We can write CSS program to add required attributes to the tags as follows:

Example-1: for <span>  using inline CSS
<html>

        <head>

                <title>CSS Span Styles</title>

        </head>

        <body>

              

            <p>  Welcome to <span style="color:red; background-color:yellow" >HTML & CSS   </span></p>

                              

        </body>

</html>

o/p:--------------------------------------------------------

Welcome to HTML & CSS



Related Posts Plugin for WordPress, Blogger...