Suggestion: Handwriting code as much as possible can effectively improve learning efficiency and depth. By default, you can use the title attribute of the <a> tag to achieve a link prompt effect. For example Copy code The code is as follows:View Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <head> <title>Ant Tribe</title> </head> <body> <a href="http://www.softwhy.com" title="Ant Tribe">Ant Tribe</a> </body> </html> Although the above code can achieve the link prompt effect, it often cannot meet the actual needs. You may need to customize the link prompt effect that is more beautiful or matches the page. The code example is as follows Copy code The code is as follows:View Code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="author" content="http://www.softwhy.com/" /> <head> <title>Ant Tribe</title> <style type="text/css"> ul { list-style:none; font-size:14px; } li { width:100px; height:30px; line-height:30px; float:left; text-align:center; position:relative; border:1px solid red; } span { display:none; } a:link,a:visited { text-decoration:none; } a:hover .tishi { display:block; width:100px; height:30px; background-color:#6C9; line-height:30px; text-align:center; position:absolute; left:80px; top:40px; color:#FFFFFF; } </style> </head> <body> <ul> <li> <a href="#" class="mylink">DIV+CSS<span class="tishi">DIV+CSS</span></a> </li> <li> <a href="#" class="mylink">jQuery<span class="tishi">jQuery</span></a> </li> <li> <a href="#" class="mylink">JS<span class="tishi">JS</span></a> </li> <li> <a href="#" class="mylink">HTML<span class="tishi">HTML</span></a> </li> <div style="clear:both"></div> </ul> </body> </html> The above code successfully achieves the effect we want. The main method is to use the hyperlink pseudo-class to display the span element |
<<: Implement a simple search engine based on MySQL
>>: idea uses docker plug-in to achieve one-click automated deployment
This article shares the installation and configur...
<br />The following are the problems I encou...
Table of contents Preface 1. The database name or...
1. Multiple calls to single arrow Once a single a...
Table of contents 1. typeof 2. instanceof 3. Cons...
Preface In case of application bug or DBA misoper...
Harbor Harbor is an open source solution for buil...
1. What is pip pip is a Python package management...
Phenomenon: Run an image, for example, ubuntu14.0...
Table of contents Advantage 1: Optimization of di...
Introduction to Flex Layout Flex in English means...
On Saturday, the redis server on the production s...
Brotli is a new data format that can provide a co...
The article mainly records the simple installatio...
Table of contents 1. v-text (v-instruction name =...