button if you want the form button to change the old face of the rigid board, it is a good idea to use the method presented in this paper to make it more attractive by using the dynamic transform style as the other navigation menus in the Web page and still have its special surface single button function. Take a look at the example shown below.
One, dynamic Transform text button
The mouse is not on the button
The mouse is on the button
You see! Is this button good?! The idea of making this effect is this, the use of CSS properties can dynamically change the characteristics of the first button to define two appearance style, and then add two events in the <input> tag, namely Onmuseover (mouse on the button) and onmuseout (mouse left button), We use these two events to call different CSS defined button appearance style, so as to achieve the effect of dynamic transformation. In order to improve the utilization of CSS (if there are more than one button, you can reuse), put the CSS between <style type= "Text/css"
<!--
. style1 {font-size: 12px; Background: #CCCCFF; Border-width:thin thin thin thin; Border-color: #CCCCFF #CCCCCC #CCCCCC #CCCCFF}
. style2 {font-size:12px; font-weight:bold; background: #CCFFCC; Borde R-width:thin medium medium thin; Border-color: #CCFF99 #999999 #999999 #CCFF99}
</style>
The code for this example button is as follows:
<input type= "Submit" Name= "Submit" value= "submitted" class= "Style1" >
from the above code, you can see that when the mouse moves over the button, that is, the Onmuseover event occurs, the button will adopt the style defined by Style2 When the mouse moves the button, that is, the Onmuseout event occurs, then the button adopts the style defined by Style1 to achieve the purpose of dynamic change. The role of the class= "Style1" in the back is to keep the consistency of the button appearance when the onmouseover, onmouseout, and the two events do not occur, using the style defined by Style1.
Two, dynamic Transform image button
The mouse is not on the button
The mouse is on the button
This example and the previous example in the production of ideas and production methods are not much different, but the use of two pictures to make the button background, but the effect is unusual. Be aware of two points when making a button for this effect:
1, as a button background pictures of the best tool transparent background gif pictures, so you can make a variety of shapes of buttons, will have a strong personality;
2, the size of the background picture to be consistent with the size of the button, otherwise, because the background tile fill, will make the button unrecognizable.
The following is the CSS code for this example between <style type= "Text/css" >
<!--
. style3 {font-size:12px; Background:url (image/buttonbg1.gif); border:0px; width:60px; height:22px}
. style4 {font-size:12px; Font-weight:bold background:url (image/buttonbg2.gif); border:0px 0; width:60px; height:22 px
-->
</style>
The button code for this example is as follows:
<input type= "Submit" Name= "Submit2" value= "Submit" class= "Style3" >
You can see from the button code that it is exactly the same as the button code for example one, however, the CSS code in this example has a big difference, here to note: The URL behind the parentheses is the button background image address, which contains the path of the picture file name, you are in the actual production to change it to the actual location of the picture.
Let me say one more word, if you use graphical web-making tools (such as Dreamweaver), then the effects of CSS, usually in the editing window is not visible, such as the button effect of this article, only in the preview to see, in the editing window is still the form of default look like.