CSS pseudo-class - Dynamic Link

October 20, 2010

Pseudo-classes can be seen as a special class of selectors, is to support CSS, the browser can be automatically recognized by a special selector. Its biggest use is to link can be defined in different states result in different styles.

1. Syntax

Pseudo-class syntax is the syntax in the original together with a pseudo-class (pseudo-class):
selector: pseudo-class (property: value)
(Selector: pseudo-class (property: value))
Pseudo-class and class is different because the CSS has been defined, not as arbitrary as the class selector to use other names, according to the above syntax can be interpreted as objects (selector) in a particular state (pseudo-class) style.

Class selectors and other selectors and pseudo classes can also mix:
selector.class: pseudo-class (property: value)
(Selectors. Categories: pseudo-class (property: value))

2. Anchor pseudo-class

We are the most common is 4 a (anchor) element of the pseudo-class, which indicates a dynamic link in 4 different states: link, visited, active, hover (not visited links, visited links, active links, and mouse to stay in the link). We define each different effects:
a: link (color: # FF0000; text-decoration: none) / bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware not access the link to backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news : 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /
a: visited (color: # 00FF00; text-decoration: none) / bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware visited links backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news : 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /
a: hover (color: # FF00FF; text-decoration: underline) / bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware mouse on the link to backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news : 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /
a: active (color: # 0000FF; text-decoration: underline) / bin / boot / dev / etc / home / lib / lost + found / media / misc / mnt / net / opt / proc / root / sbin / selinux / srv / sys / tmp / u01 / usr / var / vmware activate the link backup / bin / bin_old / conf / data / eshow / log / maint / news: 10 / news: 11 / news: 12 / news: 13 / news: 14 / news: 15 / news: 16 / news: 17 / news: 18 / news: 2 / news: 3 / news: 4 / news: 5 / news: 6 / news: 7 / news: 8 / news: 9 / seeds / svn / tasks / tmp / xml2dict-read-only /
(The example above, this link did not visit the red color is not underlined, not underlined in green after the visit, the activation link in blue and is underlined, mouse, purple when the link and is underlined)
Note: Sometimes this link to visit the former effect when the mouse point to the link and the link to visit the link after the mouse again, with no effect of the point. This is because you put a: hover on the a: visited the front, so the back of high priority because, when the access link after the ignored a: hover effect. Therefore, under the laminated sequence, we define these links in style, must follow a: link, a: visited, a: hover, a: actived in the order written.

3. Pseudo-classes and class selectors

The pseudo-class and class together, so he can do with a page of links to different groups of effects, for example, we define a set of links to red, and blue after the visit; another group of green, visit the Yellow:
a.red: link (color: # FF0000)
a.red: visited (color: # 0000FF)
a.blue: link (color: # 00FF00)
a.blue: visited (color: # FF00FF)
Now used in a different link:
This is the first group of links
This is the second link

4. Other pseudo-classes

In addition CSS2 also defines the first word and the first line (first-letter and first-line) of the pseudo-class elements can be the first word or first-line set different styles.
Look at the example below, the paragraph mark at the first word in the definition of size as the default text size of 3 times:

Comments »

The URI to TrackBack this entry is: http://ridgewayabner14.blogsome.com/2010/10/20/css-pseudo-class-dynamic-link/trackback/

No comments yet.

RSS feed for comments on this post.

Leave a comment

Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>



Anti-spam measure: please retype the above text into the box provided.

Get free blog up and running in minutes with Blogsome | Theme designs available here