css hover下拉菜单_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:17:41
Original
1128 people have browsed it

本帖最后由 BaronZ 于 2012-12-19 15:41:05 编辑

我的代码现在是鼠标移过root的时候,下拉菜单出现在root下面。我想改成鼠标移过去的时候,下拉菜单出现在root的右边(和root同一行),可以吗?要怎么改代码?
  ul.cssMenu, ul.cssMenu ul{	list-style:none;	margin:0; 	padding:-10;	position: relative;}ul.cssMenu ul 						{         display:none; /*initially menu item is hidden*/        position: absolute; /*absolute positioning is important for menu to float*/        }ul.cssMenu li:hover > ul 			{ 	display:block;	background-color:red;}
Copy after login

<html><link href="1.css" type="text/css" rel="stylesheet" /><ul class="cssMenu">	<li>		<font color="blue">root<font>           		<ul>			<li><a href=#>sub</a></li>		</ul>	</li></ul></html>
Copy after login


回复讨论(解决方案)

感谢分享经验

ul.cssMenu li:hover > ul            {     display:block;    background-color:red;    top:-150px;    left:50px;}
Copy after login

好像是定位有问题

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!