LaptopGuard AcademyLaptopGuard Academy
  • Kursus Online
    • MODUL

      • LGA Schematic 101
      • Transistor 101
      • Power Regulator & IC’s
      • Kapasitor
      • Resistor
      • Reballing Class
      • Dioda

      Promo

      • BASIC Class
      • ADVANCE Class
      • MASTER Class
  • Blog
  • Program Afiliasi
      • DAFTAR LOGIN

        Connect with:

        Login with Facebook Login with Google

        Login with your site account

        Lost your password?

        Not a member yet? Register now

    • Kursus Online
      • MODUL

        • LGA Schematic 101
        • Transistor 101
        • Power Regulator & IC’s
        • Kapasitor
        • Resistor
        • Reballing Class
        • Dioda

        Promo

        • BASIC Class
        • ADVANCE Class
        • MASTER Class
    • Blog
    • Program Afiliasi
    • Home
    • Pseudo-classes

    Pseudo-classes

    • Posted by anton
    • Date June 5, 2015
    Pseudo classes are bolted on to selectors to specify a state or relation to the selector. They take the form ofselector:pseudo_class { property: value; }, simply with a colon in between the selector and the pseudo class.

    Links

    link, targeting unvisited links, and visited, targeting, you guessed it, visited links, are the most basic pseudo classes.

    The following will apply colors to all links in a page depending on whether the user has visited that page before or not:

    
    a:link {
        color: blue;
    }
    
    a:visited {
        color: purple;
    }
    

    Dynamic Pseudo Classes

    Also commonly used for links, the dynamic pseudo classes can be used to apply styles when something happens to something.

    • active is for when something activated by the user, such as when a link is clicked on.
    • hover is for a when something is passed over by an input from the user, such as when a cursor moves over a link.
    • focus is for when something gains focus, that is when it is selected by, or is ready for, keyboard input.
    focus is most often used on form elements but can be used for links. Although most users will navigate around and between pages using a pointing device such as a mouse those who choose note to, or are unable to do so, such as those with motor disabilities, may navigate using a keyboard or similar device. Links can be jumped between using a tab key and they will gain focus one at a time.

    
    a:active {
        color: red;
    }
    
    a:hover {
        text-decoration: none;
        color: blue;
        background-color: yellow;
    }
    
    input:focus, textarea:focus {
        background: #eee;
    }
    
    focus isn’t supported by some of the older browsers so be careful not to use it for anything vital.

    First Children

    Finally (for this article, at least), there is the first-child pseudo class. This will target something only if it is the very first descendant of an element. So, in the following HTML…

    
    <body>
        <p>I’m the body’s first paragraph child. I rule. Obey me.</p>
        <p>I resent you.</p>
    ...
    

    …if you only want to style the first paragraph, you could use the following CSS:

    
    p:first-child {
        font-weight: bold;
        font-size: 40px;
    }
    
    CSS3 has also delivered a whole new set of pseudo classes: last-child, target, first-of-type, and more.

    • Share:
    anton

    Previous post

    Positioning
    June 5, 2015

    Next post

    PHP Install
    5 June, 2015

    Search

    Categories

    • Blog
    • Business
    • Design / Branding
    • Uncategorized

    Latest Courses

    Learn Python – Interactive Python Tutorial

    Learn Python – Interactive Python Tutorial

    Rp 69
    Your Complete Guide to Photography

    Your Complete Guide to Photography

    Rp 60
    Learning jQuery Mobile for Beginners

    Learning jQuery Mobile for Beginners

    Rp 30

    Latest Posts

    demo_image
    Why You Should Read Every Day
    20Jan2016
    demo_image
    Relaxing after work
    20Jan2016
    demo_image
    Online Learning Glossary
    20Jan2016
    • About Us
    • Blog
    • Contact
    • Become a Teacher

    LAPTOP GUARD ACADEMY

    Laptop Guard Academy adalah pusat pelatihan laptop yang menghasilkan alumni handal dan memiliki kompetensi yang berkualitas. Dan sekarang kami memiliki kelas online yang dapat diakses dimana saja, kapan saja.

    LaptopGuard Academy

    Jika ada yang ingin berkonsultasi lebih lanjut, silakan kontak langsung melalui akun Facebook saya Maula Hassan
    PS:
    Info tentang pelatihan teknisi laptop silakan hubungi
    081929041569
    085228201684
    BB 3144411b
    Laptopguard.co.id

    Jl. Glagahsari No. 100
    Umbulharjo, D.I. Yogyakarta
    Indonesia, 55164

    +62 274 419927

    academy@laptopguard.co.id

    JADI TEKNISI HANDAL SEKARANG JUGA!
    Daftar GRATIS Sekarang
    • Privacy
    • Terms
    • Sitemap

    Copyright © 2016 LaptopGuard Academy. All rights reserved.

    Made with ♥ in Yogyakarta by Pixld.co.