When you hover the mouse over the menu in sequence, different pages can be displayed at the same position

Source: Internet
Author: User

Information

This is an adaptation of cssplay's webmaster based on its recently created dropdown and flyout menus. When you hover your mouse over the menu in sequence, different pages can be displayed at the same position, it can be found in opera, ie5.5, IE6, IE7 beta, Safari 1.3.2 & Firefox. is not compatible with Mac ie5.

When hovering over a menu or page, text, images, and links are displayed. the scroll bar must be added to each page.

Style

For non-ie browsers, it is relatively simple to use only one style sheet.

<LINK rel = "stylesheet" Media = "all" type = "text/CSS" href = "one_page.css"/>

/* Common styling */
/* Set up the overall width of the menu Div, the font and the margins with a relative position */

. Menu {
Font-family: verdana, Arial, sans-serif;
Width: 750px;
Margin: 0;
Position: relative;
}
/* Remove the bullets and set the margin and padding to zero for the unordered list */
. Menu ul {
Padding: 0;
Margin: 0;
List-style-type: none;
Border: 0;
}
/* Float the list so that the items are in a line */
. Menu ul Li {
Float: left;
}
/* Style the links to be 249px wide by 30px high with a top and right border 1px solid white. Set the background color and the font size .*/
. Menu ul Li a,. Menu ul Li A: visited {
Display: block;
Text-align: center;
Text-Decoration: none;
Width: 249px;
Height: 30px;
Color: #000;
Border: 1px solid # FFF;
Border-width: 1px 1px 0 0;
Background: # c9c9a7;
Line-Height: 30px;
Font-size: 11px;
}
/* Make the dropdown ul invisible */
. Menu ul Li ul {
Display: none;
}

/* Specific to non ie browsers */
/* Set the background and foreground color of the Main Menu Li on hover */
. Menu ul Li: hover {
Color: # FFF;
Background: # b3ab79;
}
/* Make the sub menu ul visible and position it beneath the first list item */
. Menu ul Li: hover ul {
Text-align: left;
Display: block;
Position: absolute;
Top: 30px;
Left: 0;
Text-align: left;
}
/* Make the sub menu ul li the full width with padding and border. Add an auto scroll bar */
. Menu ul Li: hover ul Li {
Background: # Eee;
Color: #000;
Padding: 10px;
Width: 689px;
Height: 180px;
Overflow: auto;
Border: 20px solid # b3ab79;
}
/* Float the image left with padding and no border */
. Menu ul Li: hover ul Li IMG {
Float: left;
Padding: 10px 10px 10px 0;
Border: 0;
}
/* Style the paragraph font height */
. Menu ul Li: hover ul li p {
Font-size: 0.9em;
}
/* Style the background and foreground color of the submenu links */
. Menu ul Li: hover ul Li {
Display: inline;
Background: # Eee;
Color: # c00;
Text-Decoration: underline;
Border: 0;
}
/* Style the background and forground colors of the links on hover */
. Menu ul Li: hover ul Li A: hover {
Text-Decoration: none;
Color: #000;
}

Internet Explorer also needs to add a special one for it and use conditions to judge the addition.

<! -- [If lte ie 6]>
<LINK rel = "stylesheet" Media = "all" type = "text/CSS" href = "one_page_ie.css"/>
<! [Endif] -->

/* Styling specific to Internet Explorer ie5.5 and ie6. yet to see if IE7 handles Li: hover */

/* Get rid of any default table style */
Table {
Border-collapse: collapse;
Margin: 0;
Padding: 0;
}
/* Ignore the link used by 'other browsers '*/
. Menu ul Li A. Hide,. Menu ul Li A: visited. Hide {
Display: none;
}
/* Set the background and foreground color of the Main Menu link on hover */
. Menu ul Li A: hover {
Color: # FFF;
Background: # b3ab79;
}
/* Make the sub menu ul visible and position it beneath the first list item */
. Menu ul Li A: hover ul {
Text-align: left;
Display: block;
Position: absolute;
Top: 31px;
Left: 0;
}

/* Make the sub menu ul li the full width with padding and border. Add an auto scroll bar */
. Menu ul Li A: hover ul Li {
Background: # Eee;
Color: #000;
Padding: 10px;
Width: 746px;
Height: 240px;
Overflow: auto;
Border: 20px solid # b3ab79;
W \ idth: 689px;
He \ ight: 180px;
}
/* Float the image left with padding and no border */
. Menu ul Li A: hover Li IMG {
Float: left;
Padding: 10px 10px 10px 0;
Border: 0;
}
/* Style the paragraph font height */
. Menu ul Li A: hover P {
Font-size: 0.7em;
F \ ont-size: 1em;
}
/* Style the background and foreground color of the submenu links */
. Menu ul Li A: hover ul Li {
Display: inline;
Width: 1px;
Word-wrap: normal;
Background: # Eee;
Color: # c00;
Text-Decoration: underline;
Border: 0;
}

/* Style the background and forground colors of the links on hover */
. Menu ul Li A: hover {
Text-Decoration: none;
Color: #000;
}

XHTML

You will see that the conditional judgment is used to add a table to IE. other browsers will not use the table, but will normally use the unordered list. Document Type Declaration must be added. Otherwise, it cannot work normally.
---------------------------------------------------------------------------------
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 strict // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml" XML: lang = "en">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> Stu Nicholls | CSS play | cross browser tabbed pages with embeded Links </title>
<Meta name = "author" content = "Stu Nicholls"/>
<Meta name = "keywords" content = "cssplay, CSS play, cascading, style, sheets, css1, css2, CSS, xhtml1.1, W3C, doing it with style, recommendations, opacity, box Model, Mozilla, opera, Netscape, Internet Explorer, V6, v7.23, techniques, layout, three column, cutting edge, experimental, validation, validate, navigation, pop-up, pull-down, menus, tips, tricks, CSS Mouseover, mouseovers, CSS experiments, CSS demonstrations "/>
<Meta name = "Description" content = "CSS ~ Cutting edge Cascading Style Sheets. Experiments in CSS "/>
<LINK rel = "stylesheet" Media = "all" type = "text/CSS" href = "http://www.forest53.com/tutorials/onepage/one_page.css"/>
<Style type = "text/CSS">
Body {text-align: center; font-family: verdana, Arial, sans-serif; font-size: 76%; color: #000; Background: # fff url(back.gif) repeat-X; padding: 0; Border: 0; margin: 0 ;}
</Style>

<! -- [If lte ie 6]>
<LINK rel = "stylesheet" Media = "all" type = "text/CSS" href = "http://www.forest53.com/tutorials/onepage/one_page_ie.css"/>

<! [Endif] -->

<! -- [If lte ie 6]>
<Style>
# Ads {display: none ;}
# Smallads {display: none ;}

# Adsie {clear: Both; text-align: center; width: 750px; margin-top: 10px ;}
# Smalladsie {clear: Both; text-align: center; width: 468px; margin-top: 10px ;}
</Style>
<! [Endif] -->

</Head>

<Body>
<Div class = "menu" style = "margin: 10px auto;">
<Ul>
<Li> <a class = "hide" href = "# Nogo"> John Constable </a>
<! -- [If lte ie 6]>
<A href = "../menu/index.html"> John Constable
<Table> <tr> <TD>
<! [Endif] -->
<Ul>
<Li>
<P> although he showed an early talent for art and began painting his native Suffolk scenery before he left school, his great originality matured slowly. </P>

<P> he committed himself to a career as an artist only in 1799, when he joined the Royal Emy schools and it was not until 1829 That He Was grudgingly made a full Academician, elected by a majority of only one vote. </P>
<P> in 1816 he became always Ally secure on the death of his father and married Maria Bicknell after a seven-year courtship and in the fact of strong opposition from her family. duringthe 1820 s he began to win recognition: the Hay Wain (National Gallery, London, 1821) won a gold medal at the Paris Salon of 1824 and constable was admired by <a href = "http://www.ibiblio.org/wm/paint/auth/delacroix/"> delstmix </a> and bonington among others. </P>
<P> his wife died in 1828, however, and the remaining years of his life were clouded by demo-dency. </P>
<P> This text is an excerpt from <a href = "http://www.ibiblio.org/wm/paint/auth/constable/"> the & nbsp; webmuseum, & nbsp; Paris </a> </P>
</LI>
</Ul>
<! -- [If lte ie 6]>
</TD> </tr> </table>
</A>
<! [Endif] -->
</LI>
<Li> <a class = "hide" href = "# Nogo"> clude Monet </a>
<! -- [If lte ie 6]>
<A href = "# Nogo"> clude Monet
<Table> <tr> <TD>
<! [Endif] -->
<Ul>
<Li>
<P> his youth was spent in Le Havre, where he first excelled as a caricaturist but was then converted to landscape painting by his early mentor <a href = "http://www.ibiblio.org/wm/paint/auth/boudin/"> boudin </a>, from whom he derived his firm predilection for painting out of doors. </P>

<P> in 1859 he studied in Paris at the atelier Suisse and formed a friendship with <a href = "http://www.ibiblio.org/wm/paint/auth/pissarro/"> Pissarro </a>. after two years 'military service in Algiers, he returned to Le Havre and met <a href = "http://www.ibiblio.org/wm/paint/auth/jongkind/"> jongkind </a>, to whom he said he owed 'the definitive education of my eye '. </P>
<P> he then, in 1862, entered the studio of gleyre in Paris and there met Renoir, Sisley, and bazille, with whom he was to form the nucleus of the impressionist group. </P>
<P> Monet's partition tion to painting out of doors is already strated by the famous story concerning one of his most ambitious early works, women in the Garden (MUS e d 'Orsay, paris; 1866-67 ). the picture is about 2.5 meters high and to enable him to paint all of it outside he had a trench dug in the garden so that the canvas cocould be raised or lowered by pulleys to the height He required. </P>
<P> <a href = "http://www.ibiblio.org/wm/paint/auth/courbet/"> Courbet </A> visited him when he was working on it and said Monet wocould not paint even the leaves in the background unless the lighting conditions were exactly right. </P>
<P> This text is an excerpt from <a href = "http://www.ibiblio.org/wm/paint/auth/monet/"> the & nbsp; webmuseum, & nbsp; Paris </a> </P>
</LI>
</Ul>
<! -- [If lte ie 6]>
</TD> </tr> </table>
</A>
<! [Endif] -->
</LI>
<Li> <a class = "hide" href = "# Nogo"> Vincent Van Gogh </a>
<! -- [If lte ie 6]>
<A href = "../layouts/index.html"> Vincent Van Gogh
<Table> <tr> <TD>
<! [Endif] -->
<Ul>
<Li>
<P> Gogh, Vincent (Willem) Van (B. march 30,185 3, Zundert, Neth. -- d. july 29,189 0, Auvers-sur-Oise, near Paris), generally considered the greatest Dutch painter and draughtsman after <a href = "http://www.ibiblio.org/wm/paint/auth/rembrandt/"> Rembrandt </a>. </P>

<P> with <a href = "http://www.ibiblio.org/wm/paint/auth/cezanne/"> Cézanne </a> and <a href = "http://www.ibiblio.org/wm/paint/auth/gauguin/"> Gauguin </a> the greatest of post-impressionist artists. he powerfully influenced the current of <a href = "http://www.ibiblio.org/wm/paint/glo/expressionism/"> expressionism </a> in modern art. his work, all of it produced during a period of only 10 years, hauntingly conveys through its striking color, coarse brushwork, and contoured forms the anguish of a mental illness that eventually resulted in suicide. among his masterpieces are numerous self-portraits and the well-known <a href = "http://www.ibiblio.org/wm/paint/auth/gogh/starry-night/"> the & nbsp; starry & nbsp; night </a> (1889 ). </P>
<P> This text is an excerpt from <a href = "http://www.ibiblio.org/wm/paint/auth/gogh/"> the & nbsp; webmuseum, & nbsp; Paris </a> </P>
</LI>
</Ul>
<! -- [If lte ie 6]>
</TD> </tr> </table>
</A>
<! [Endif] -->
</LI>
</Ul>
<Div class = "clear"> & nbsp; </div>
</Div>

</Body>

</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.