The method of realizing mouse hover hint with pure CSS

Source: Internet
Author: User

This article describes a pure CSS to implement the mouse hover hint method. Share to everyone for your reference. The specific analysis is as follows:

This is a more beautiful mouse hover prompt effect, with a pure CSS code to achieve, the mouse placed on the picture will show a layer, that is, hover when the hint, in this box you can also add a picture or a list, depending on your play, the background color of the balloon and text color you can adjust.

The

code is as follows:


<! 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" >


<head>


<meta http-equiv= "Content-type" content= "text/html"; Charset=utf-8 "/>


<title> mouse hover hint effect </title>


<style>


* {


margin:0;


padding:0;


}


Div {


margin:130px;


List-style:none;


}


div img {


border:0;


}


Div a {


color: #fff;


Text-decoration:none;


position:relative;


Display:block;


}


Div span {


font-size:12px;


Display:none;


}


Div a:hover {


background:;


}


Div a:hover span {


padding:3px;


Background:skyblue;


color: #fff;


font-size:9pt;


border-width:1px 2px 2px 1px;


Border-color: #333;


Border-style:solid;


Position:absolute;


top:-30px;


left:0;


Display:block;


}


</style>


</head>


<body>


<div>


<a href= "" >


<img src= "images/wall_s5.jpg" alt= ""/>


<span> Welcome to our regular visit! </span>


</a>


</div>


</body>


</html>

I hope this article will help you with the DIV+CSS web design.

Related Article

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.