Example tutorial on setting the background color to transparent

零下一度
Release: 2017-07-20 15:12:43
Original
2203 people have browsed it

1. The small triangle is achieved by setting a large enough border for a div and setting its top border, right border, left border, and background color to transparent, as follows:

<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style type="text/css">
			#demo {
				width: 0;
				height: 0;
				/*边框的宽20px*/
				border-width: 20px;
				/*边框样式,实线*/
				border-style: solid;
				/*边框颜色*/
				border-color: transparent transparent red transparent;
			}
		</style>
	</head>

	<body>
		<!--小三角,transparent透明的,-->
	
		<div id="demo">
			
		</div>
	</body>

</html>
Copy after login

2. Problems with the mobile version of the a tag:

1》When you click the a tag, it will have a default background color. Solution

1 -webkit-tap-highlight-color:transparent;

 2》Underline may appear when clicked, solution

  

1 text-decoration: none; //或者2 3          border: none;//或者4 5          outline:none;
Copy after login
 3>Underline appears when the mouse is placed on it, solution;

 

a:hover{
    
text-decoration:none;
}
Copy after login
 The a tag is an inline tag, if you want Set its width, height or multiple styles through display: block; to turn it into a block-level label.

  

The above is the detailed content of Example tutorial on setting the background color to transparent. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template