下拉框——怎么像京东那样,把两行字并列排放呀,试了好多遍都不行,求支援

原创 2019-01-21 19:03:35 313
摘要:<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>京东(JD.COM)-正品低价·品质保证</title><!-- 引入外部样式表 --><!-- <link rel="s

<!DOCTYPE html>


<html lang="en">


<head>


<meta charset="UTF-8">


<title>京东(JD.COM)-正品低价·品质保证</title>


<!-- 引入外部样式表 -->


<!-- <link rel="stylesheet" href="css/demo04.css"> -->


<link rel="stylesheet" href="css/font-awesome-4.7.0/css/font-awesome.min.css">


<style>

/* 清除浏览器自带边距 */


*{


margin: 0;


padding: 0;


}




/* 顶部布局,图片用金色代替 */


.top{


width: 100%;


background: #BE8B4C;


}


/* 顶部内容模拟 */


.top_content{


width: 1200px;


height: 80px;


background: #FEDF63;


margin: 0px auto;


}




.top_content h1{


color: white;


text-align: center;


line-height: 80px;


}




/* 头部布局 */


.header{


/* height: 30px; */


width: 100%;


background: #E3E4E5;


margin: 0px auto;

}




.header_content{


width: 1200px;


height: 30px;


background: #E3E4E5;


margin: 0px auto;


}




/* 头部左侧 */


.header_left{


/* background: pink; */


line-height: 30px;


float:left;


margin-left:30px;


}




/* 头部右侧 */


.header_right{


/* background:pink; */


line-height:30px;


float:right;


margin-right: 10px;


}




/* 清除浮动 */


.clear{


clear: both;


}




/* 调整a标签的样式 */


a{

display: inline-block;


text-decoration: none;


color:#999;


font-size:12px;


position: relative;

}




/* 调整span标签样式 */


span{


font-size: 2px;


color: #999


}




i{


margin:3px;


}




/* 设置鼠标滑过变色 */


.bj:hover{


color:red;


}







/* 清除li标签的样式 */

li{

list-style: none;

}



/* 设置ul标签的属性并隐藏 */

a ul{

border:1px solid #c6c6c6;

border-top: none;

display: none;

}


/* 设置显示ul标签 */

a:hover ul{


/* 这里使其转变成可与其他元素共存一行的块级元素 */

display: inline-block;


/* 使ul标签用绝对定位脱离文档流 */

position: absolute;


/* 字数太多,设定个宽,不知道对不对 */

width: 100px;


}



/* 设置li标签样式 */


ul li{

color: #999;

height: 30px;

line-height: 30px;

margin:5px 5px;

}


/* 鼠标滑过li标签时背景色改变 */

ul li:hover{

color: red;

}



</style>




</head>


<body>


<!-- top区 -->


<div class="top">


<div class="top_content">


<h1>京东年货节</h1>


</div>


</div>




<!-- header区     -->


<div class="header">


<div class="header_content">


<!-- 左侧 -->


<div class="header_left">


<a href=""><i class="fa fa-map-marker" style="color:red"></i>北京</a>


</div>


<!-- 右侧 -->


<div class="header_right">


<a href="" class="bj">你好,请登录</a>


<span>|</span>


<a href="" style="color:red">免费注册</a>


<span>|</span>


<a href=""class="bj">我的订单</a>


<span>|</span>


<a href=""class="bj">我的京东<i class="fa fa-angle-down"></i>

<!-- 下拉列表 -->


<ul>

<li>待处理订单</li>

<li>返修退换货</li>

<li>降价商品</li>

<li>我的问答</li>

<li>我的关注</li>

</ul>


</a>


<span>|</span>


<a href=""class="bj">京东会员</a>


<span>|</span>


<a href="">企业采购<i id="a"  class="fa fa-angle-down"></i>

<ul>

<li>待处理订单</li>

<li>返修退换货</li>

<li>降价商品</li>

<li>我的问答</li>

<li>我的关注</li>

</ul>

</a>


<span>|</span>


<a href="">客户服务<i  id="a" class="fa fa-angle-down"></i>

<ul>

<li>待处理订单</li>

<li>返修退换货</li>

<li>降价商品</li>

<li>我的问答</li>

<li>我的关注</li>

</ul>

</a>


<span>|</span>


<a href="">网站导航<i id="a"  class="fa fa-angle-down"></i>

<ul>

<li>待处理订单</li>

<li>返修退换货</li>

<li>降价商品</li>

<li>我的问答</li>

<li>我的关注</li>

</ul>

</a>


<span>|</span>


<a href="">手机京东</a>




</div>




</div>


<!-- 清除浮动 -->


<div class="clear"></div>


</div>


</body>


</html>




批改老师:韦小宝批改时间:2019-01-22 09:20:56
老师总结:你在这里问不好回答啊,你可以直接QQ联系老师,发一下你的效果图 在这里直接给你写代码很不方便,而且你看着也不是很方便

发布手记

热门词条