Implementation ideas:
The menu is contained in a div. The height of the div is 30px, And the menu length is 120px. Set the overflow of the div to hidden.
In this way, the remaining 90px contents of the menu are hidden.
When hover is used, set the div overflow value to visible. In this way, the remaining 90px content is visible.
The Demo code is as follows:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-
-
- <style type="text/css">
- .tdiv
- {
- width: 100px;
- height: 30px;
- overflow: hidden;
- text-align: center;
- background: red;
- }
- .tdiv:hover
- {
- overflow: visible;
-
- }
- </style>
-
- <body>
- <div class="tdiv">
- <div style="width: 100px; height: 30px; background: green; text-align: center;">
- Menu1</div>
- <div style="width: 100px; height: 30px; background: green; text-align: center;">
- Menu2</div>
- <div style="width: 100px; height: 30px; background: green; text-align: center;">
- Menu3</div>
- <div style="width: 100px; height: 30px; background: green; text-align: center;">
- Menu4</div>
- </div>
- </body>
-
This article is from the "one blog" blog, please be sure to keep this source http://cnn237111.blog.51cto.com/2359144/959338