This example uses a pure CSS as a button without JavaScript code. This is not to imply that JavaScript is bad or stale, but rather to illustrate the capabilities of CSS.
============================================================
We need code with leading ideas, which is an example. This code is to be used in a sixth-generation browser, ie6+, Nn/mozilla 6+, or IE5.5. This example uses a pure CSS as a button without JavaScript code. This is not to imply that JavaScript is bad or stale, but rather to illustrate the capabilities of CSS.
The code in this article has some new advantages over traditional button code.
First, it's a file-type code that doesn't require any images, so don't download anything!
Second, it's easy to maintain. For example, add a link, add a button, change the color of these things, just edit one or two lines of code in the style sheet.
These features are well liked by programmers. But the code here is not backward-compatible and will draw a gap between the people who are unwilling to change their browsers and the company.
or let the people running in front of you look at this code:
<style type= "Text/css" >
#elButton a {
Color: #000000;
font-size:10px;
Font-family:verdana;
Font-weight:bold;
Text-decoration:none;
border:4px outset Aqua;
Background-color: #00ffff;
Display:block;
width:160px;
PADDING:3PX 5px;
margin:1px;
}
#elButton A:hover {
Background-color: #00c0c0;
Color: #000000;
padding-left:4px;
BORDER:4PX inset Aqua;
}
</style>
<div id= "Elbutton" >
<div><a href= "#" >java Script </div>
<div><a href= "#" >dynamic HTML </div>
<div><a href= "#" >server Side </div>
<div><a href= "#" >client Side </div>
</div>
This is not a JavaScript button, it's not bad. Let's take a look at how CSS works.
Here is the first div style:
#elButton a {
Color: #000000;
font-size:10px;
Font-family:verdana;
Font-weight:bold;
Text-decoration:none;
border:4px outset Aqua;
Background-color: #00ffff;
Display:block;
width:160px;
PADDING:3PX 5px;
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.