html导航栏悬浮在最右边

html导航栏悬浮在最右边,第1张

首先给导航栏来个float:right即可。

2、其次在html中,右边图片的代码是“imgalign=right”。“对齐”属性用于设置图片元素相对于其他元素的方向。

3、最后当属性值为“右”时,图片元素将显示在右侧。

<head>

<title></title>

<style type="text/css">

#u1

{

float:left

background-color:rgba(180,180,180,0.6)

}

li

{

width:84px

list-style-type:none

float:left

font-size:20px

font-weight:bold

}

.style1

{

background-color:Blue

}

.style2{background-color:white}

</style>

<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>

<script type="text/javascript">

$(function () {

$("li").mousemove(function () {

$(this).addClass("style1").mouseout(function () {

$(this).removeClass("style1")

})

})

})

</script>

</head>

<body>

<ul id="u1">

<li>首页</li>&nbsp

<li>产品中心</li>&nbsp

<li>新闻中心</li>&nbsp

<li>咨询投诉</li>&nbsp

<li>关于我们</li>

</ul>

</body>

</html>


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/6303549.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-20
下一篇 2023-03-20

发表评论

登录后才能评论

评论列表(0条)

保存