您现在的位置是:网站首页> 编程资料编程资料

css 背景图片定位在菜单效果中的应用实例_CSS教程_CSS_网页制作_

2021-09-08 1133人已围观

简介 这是一款效果不错的菜单,在设计方面具有鲜明的风格。其实不管外在表现形式如何变化,经过分析,WEB界面元素都可以分解成具有语义的HTML编码。

这款菜单大家需要注意HOVER状态下背景图片定位发生了变化,从而实现了这样的效果。

本实例是一位国外的朋友所写,不进行任何翻译,直接发出来,大家可以偿试阅读,如果遇到困难可以求助于翻译软件。
不断的提高自己的英文阅读能力也是我们一直所提倡的,让我们一起努力吧!

Overview
  Here are the required graphics to assembe the menu


1. Main background
  Open the Photoshop file. Turn off the menu text Layer Group and save the main background as menu-bg.jpg.


2. Button graphics
  Turn off the background Layer Group and leave only the menu text layers visible. Make a rectangle selection cover the "home" item, go to menu Edit > Copy Merged (Cmd + Shift + C).


  Create a new file and take note of the file dimension (w x h), in my case the "home" graphic is 144 x 58px. Paste the "home" graphic in the new file. Go to menu Image > Canvas Size, adjust the image height x 2 (58 + 58 = 116px). Duplicate the home graphic layer and align it to the bottom. Erase the highlight strokes in the upper layer.


  Here is how the hover effect will work. We will set the link button to 144 x 58px, when mouseover, we will shift the background image from top to bottom.


  Repeat this step for the other buttons. You should have the follow graphics:


3. HTML source
  When you are done with the graphics, let’s start coding. Start with an un-ordered list
-六神源码网