In Association with Amazon.in   Flipkart

Wednesday, June 12, 2013

CSS Id Style Examples

CSS Id and Class atributes to HTML tags:

The id CSS Style:

The id CSS is used to specify a style for a single, unique element.
The id attribute of the HTML element in CSS is defined with a "#".
The style rule below will be applied to the element with id="p1":

<style>
#p1
{
text-align:center;
color:green;
background-color:yellow;
}
</style>

<body>
  <p id="p1">
The id CSS is used to specify a style for a single, unique element.
The id attribute of the HTML element in CSS is defined with a "#".
The style rule below will be applied to the element with id="p1"
  </p>
</body>

CSS External Style Sheet Example

You can Link CSS Files with <link> Tag in the <head> Section as Follows:

CSS File Name: site-styles.css

<style type="text/css">
     h2 { color:#564; background-color:#EEF; }
</style>

HTML File Name: home.html

<html>
         <head>
            <title>Site Title</title>
               <link href="site-styles.css" rel="stylesheet" type="text/css" />
         </head>

        <body>
             <h2>Welcome To CSS</h2>
                <p>CSS External Styles Linking In Html File</p>
       </body
</html>

OutPut:

Welcome To CSS

CSS External Styles Linking In Html File

Thursday, May 23, 2013

CSS Internal Or Embedded Styles Examples

CSS Internal (or) Embedded Styles: It is used for Reusability in Local

In this styles are defined in the head section in the <style> tag.


Example:

<html>
<head>
   <style>
          p{
            color:green;
            font-size:40;
            font-weight:bold;
            }
   </style>
</head>

<body>
   <p> Welcome to CSS </p>
   <i> Internal (or)  Embedded  </i>
   <p> Welcome to Paragraph </p>
</body>
</html>

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

Welcome to CSS

Internal (or) Embedded

Welcome to Paragraph
---------------------------------------------------------------

Monday, April 8, 2013

CSS Types To Apply Styles


CSS is Used for re-usability and inheritance.

It is of 3 types:

þ  In Line
þ  Internal (or)  Embedded
þ  External

In Line :  CSS coding in embedded inside the tag.

Internal (or) Embedded : It is used for Reusability in Local

External: Reusability in Global. The <link> tag defines the relationship between a document and an external resource. The <link> tag is used to link to style sheets.  The rel attribute specifies the relationship between the current page and the linked web resource. 



Related Posts Plugin for WordPress, Blogger...