CSS Learning Note two

Source: Internet
Author: User

When we browse the site, we will click on some links, these links before the point, there are different effects after the point, these effects are made with the pseudo-element selector


Pseudo element selector:


is to pre-define some selectors in the httml to become pseudo-elements.

Format: Tag name: pseudo-element: class name tag name. Class Name: Pseudo element


Status of the hyperlink:

A:link: Hyperlink not clicked Status

A:visited state after being visited

A:hover the cursor moves to the status on the hyperlink (not clicked), hover

A:active status when clicking a hyperlink

Use order: l-v-h-a, before and after a click is a state

It is best to test with IE browser, some browsers may not see the effect

<style type= "Text/css" >        /* not visited       *            /a:link{background-color: #06F;  Color: #FFF;            Text-decoration:none; font-size:15px;       }        /* Mouse Hover        *             /a:hover{background-color: #FFF; color: #F00;            font-size:20px;        }        /* Click Effect        *            /a:active{background-color: #000; color: #FFF;            font-size:25px;        }        /* Click after effect        *            /a:visited{background-color: #FF9; color: #000;            Text-decoration:line-through;        }    </style>


The paragraph label also looks like the effect

P:first-line: The first line of text in a paragraph

P:first-letter: The first letter in a paragraph

: Focus: Has a focused element (Ps:ie6 not supported, Firefox,google can see effects)

    <style type= "Text/css" >              div:hover{   /* Similar to hover effect can be added to div *            /background-color: #F00;            Color: #FFF;        }        input:focus{            background-color: #F0F;        }    </style>

the combination of CSS style application:

CSS can be used in conjunction with numerous tags in html



CSS Learning Note two

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.