Some learning experience about hyperlinks in css_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:53:33
Original
1902 people have browsed it

In the book "Mastering CSS", the author explains the hyperlink part.
1. In CSS, when the priorities of two rules are the same, the rule defined later takes precedence, so for several pseudo-selectors of hyperlinks, the general order is: a: link, a:visited, a:hover, a:focus, a:active; you don’t need to write this down specifically. You will write it down after you do a few simple examples. Practice will bring you true knowledge~
2. You can use simple images to create more dazzling CSS hyperlink effects, such as underlines. You can also make some special icons to express the uniqueness and style of the connection.
3. In CSS3, you can find elements through substring matching to complete more flexible link styles with less effort, such as finding all links starting with the text http::

a[href^="http:"]{     background:url() no-repeat right top;    }
Copy after login


This will highlight all external links. Of course, you can specifically set up to cancel links to your own site:

a[href^="http://www.yoursite.com"],a[href^="http://yoursite.com"]{       background-image:none;    }
Copy after login


You can also use special styles to indicate downloaded documents and feeds:

a[href$=".pdf"]{      background:url(img/pdflink.gif) no-repeat right top;}
Copy after login

(its function is to attach a specific logo to everything with pdf keywords)

4. Create a button link
The simple thing is to use display: block to convert your row-level elements into block-level elements, and then change their background colors to realize linking and changes of buttons;
Another way is to change the button icons drawn in advance , to achieve the image flip effect;
Pixy style flip: draw all the buttons on one picture, and then use background-position to display different parts in different states. The advantage of this is that multiple The number of server calls for each image is greatly reduced;
Inspired by Pixy, the CSS wizard came into being. The idea is to put all the content such as the navigation of a website that requires a large number of images on one image. For large websites, This can greatly reduce server consumption.
5. The button effect can be achieved through CSS3 text-shadow, box-shadow and border-radius attributes, which can avoid adding images.
6. CSS also has very powerful functions, that is, you can use the display attribute and hover attribute to set things such as tool tips, information cards (such as the information cards of websites such as Zhihu that pop up), and mall information. More colorful effects such as secondary menus, instead of being as rigid as the prompts that come with the title attribute.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!