Monday 22 July 2013

CSS3 Pseudo Classes: first-of-type, last-child, first-child and last-of-type

  • first-of-type: It selects first element of same type. This is similar to first-child, which was introduced in CSS2. In practice, however, they are as different as nth-child and nth-of-type. 
            <div>
                <h2>Wuthering Heights</h2>
                <p>I have just returned...</p>
                <p>This is certainly...</p>
                <p>In all England...</p>
                <h3>By Emily Bronte</h3>
            </div>
       p:first-of-type { font-style: italic; }
       Result: I have just returned...
  • first-child: It selects the first element of the parent. If i use above div element example.
      p:first-child {text-decoration: underline;}
      Result: no element will be selected.
      if i remove <h2>Wuthering Heights</h2> element then it will select <p>I have just returned...</p>

     last-of-type &  last-child will work in the reverse way. It will select last element of same type and last element of the siblings accordingly.

CSS3 pseudo classes: Difference between only-child and only-of-type

  • Only-child: Select elements of the document tree if parent have have only one child means there is no siblings.
        <div>          
                <p>I have just returned.</p>               
        </div>
        p:only-child { text-decoration: underline; }

  • Only-of-type: Selects elements of the document tree if parent have no siblings of same type.
            <div>
                <h2>Wuthering Heights</h2>                
                <p>In all England...</p>
                <h3>By Emily Bronte</h3>
            </div>
           p:only-of-type { font-style: italic; }

Thursday 18 July 2013

Retrieve App pool password.

If you forget password of app pool, it is very difficult to retrieve password. There is a simple command for this. Just go to you command prompt and type below command:

C:\Windows\System32\inetsrv\appcmd.exe list apppool -config

It will return a XML file.