A text of the CSS style is added in a button with a graphic background, which combines the development speed and efficiency of the CSS rollover tag, thereby effectively increase the three-dimensional effect of the buttons external table image.
These graphics / CSS hybrid buttons can be easily established and loaded compared to the conventional graphics buttons because you only need to create and load an image for your blank button instead of establishing your respective images for each button.
The same image can be used on the background of all buttons of the web page. The text tag of the button is simple CSS style text.
Preloaded
One of the few problems of the graphics / CSS mixed style is that the roll effect is limited. The easiest way to use this technology is to specify the rolling effect of the CSS style text and use the same button appearance image of all rollover stats (ROLLOVER STATES). This can give you a fast, concise roll effect, but limit your development options to a certain extent.
You can also create some button images that can be used and build your CSS rules to change background images for different rolling states. However, these methods bring you more flexible design, but when the browser loads the image file, these alternate ammonium buttons will delay (unless you use a pre-load button image).
The preloaded image technology has been well known and is also accepted. The problem is that the pre-load image increases the time of webpage load and appears in the visitor browser. The first two minutes of user access is critical, so you must make the web page initialization faster. Using a graphic / CSS mix button can reduce image preload time, of course, if pre-load can be eliminated, the initialization of the page is faster.
No delay roll - do not use pre-loaded images
I have found an innovative approach that meets the alternate buttons of different roll states, which do not require loading of any image files. I first contacted this technology was discovered on the article on the site of the network designer PETR STANICEK.
To get a typical button roll effect, you usually need to build three separate images, as shown in Figure A. One is an ordinary button, one is a suspension state, and one is an activation state. The image file of the normal button will become part of the initialization page load, but the other two images will be subsequently loaded, which makes them can be used in the user's browser.
No preloading roll technique is implemented by combining all three button outsatis images, as shown in Figure B. However, there is no need to specify different background image files for each rolling state. You specify the positional offset of the composite image. During the page initialization process, the composite image file can be automatically loaded, so no pre-load is required; and there is no time to delay in the browser to obtain different image files.
The combination of large image and background image position offset can make you selectively display different parts of the image for each button state. The CSS frame size of the button text determines the percentage of the background image displayed on the browser.
For this technology, you must clear the exact level and vertical size of the appearance and use these dimensions correctly to create the CSS rule of the image file and button.
Here is a code example, and there is no pre-loaded roll technology applied to the graphics / CSS mix button. In this case, the button text is marked in a sequential list, and the three appearance of the beautiful buttons are included in the DIV with ID Menu. First, CCS is:
Div # MENU {Height: auto; width: 150px;} Div # Menuli {Height: 30px; Width: 100px; Margin: 10px; Font-Family: Arial, Helvetica, Sans-Serif; Font-Size: Small; Text-align : center; line-height: 30px; List-style-type: none; background-image: URL (images / buttons.jpg); Background-position: 0px 0px;} Div # Menuli a {Display: block; width: 100 %; Height: 100%; Text-Decoration: none; color: #fffff;} Div # Menulia: link {color: #ffff; Background-Image: URL (images / buttons.jpg); Background-Position: 0px 0px; } Div # Menulia: visited {color: #ccccccccc; background-image: URL (images / button.jpg); Background-position: 0px 0px;} Div # Menulia: Hover {font-weight: bold; color: #fffff; Background-Image: BACKGROUND-POSITION: 0PX -30PX;} Div # Menulia: Active {Font-Weight: bold; color: #ffff; Background-Image: URL (images / buttons.jpg ); Background-position: 0px -60px;} This is the HTML of these three buttons:
In the above code, note the Div # Menuli rules specify the height and size of the button. Specifies the Line-Height to match the height of the button to ensure that the text can be placed vertically in the center. The Background-Position property controls the position of the upper left corner of the background image.
In the Div # Menuli rule, the display: block attribute combined with Width: 100% and Height: 100%, can make the button box instead of being clicked.
Finally, in the independent button status rules, such as Div # Menulia: Link, Color, and Font-Weight property have established text roll effects, the same background-image and background-position are also the same function as the background image. Set the suspension status to Background-Position: 0px -30px allows the background image to 30 pixels so that the top button appearance is hidden. Similarly, set the activation state to Background-Position: 0px -60px, you can increase the background image pixel. Background-Image needs to be repeated in each rule. This technology allows you to get a three-dimensional effect with a traditional graphic button and a mix button of a fast CSS text style. Similarly, this technology enables you to achieve a delayed or no image pre-loaded graphic roll effect.
Author: Michael Meadhra in the initial stages of development on the Web in the development in this area. He published a book than the accumulation of dozens of species, including the upcoming Osborne / McGraw-Hill release "How to do everything with Dreamweaver MX 2004" ".