Getting Started - Non-delayed Turning GraphicsCSS Mixed Style Button

xiaoxiao2021-03-06  23

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:

转载请注明原文地址:https://www.9cbs.com/read-65375.html

New Post(0)