总效果:

html:

响应式CSS:

/* 网站头部 */ header {     width: 100%; } header .top {     line-height: 3rem;     padding: 0 1.5rem;     color: #fff;     background: #555;     border-bottom: 1px #ecc000 solid; } header .top .tel {     float: left; } header .top ul {     text-align: right; } header .top ul li {     display: inline-block; } header .top ul li + li {     border-left: 1px solid #999;     margin-left: -3px; } header .top ul li a {     display: inline-block;     padding: 0 1.5rem;     color: #fff; } @media only screen and (max-width: 50em) {     header .top ul li a {         padding: 0 1rem;     } } @media only screen and (min-width: 30.0625em) and (max-width: 50em) { } @media only screen and (max-width: 30em) {     header .top .tel,     header .top ul li:nth-child(3),     header .top ul li:nth-child(4) {         display: none;     } } header .main {     padding: 0; } header .main .brand {     float: left;     padding: 1rem 1.5rem 0; } header .main ul {     text-align: right; } header .main ul li {     display: inline-block;     border-left: 1px solid #f0ede9; } header .main ul li a {     display: inline-block;     padding: 0 2.5rem;     line-height: 5.5rem;     font-size: 1.6rem;     font-weight: bold;     color: #7c7a65;     text-decoration: none; } header .main ul li a:hover, header .main ul li a:active, header .main ul li a.active {     color: #ffb300;     background-color: #f8f6f1; } @media only screen and (max-width: 50em) {     header .main .brand {         float: none;         display: block;         padding: 0;         margin: 1.5rem auto 0.5rem;         text-align: center;     }     header .main ul {         text-align: center;     }     header .main ul li {         border: none;     }     header .main ul li a {         padding: 0 1.5rem;     } } @media only screen and (max-width: 30em) {     header .main ul li {         line-height: 3rem;     }     header .main ul li:first-child {         display: none;     }     header .main ul li a {         font-weight: normal;         padding: 0 0.5rem;     } }

html如何在li里加a,li里面嵌套a标签html和css小例子相关推荐

  1. html中li标签中怎么添加a标签,li里面嵌套a标签html和css小例子

    总效果: html: 响应式CSS: /* 网站头部 */ header { width: 100%; } header .top { line-height: 3rem; padding: 0 1. ...

  2. html中的li标签不换行,css li 不换行(布局,内容)

    参考这里 ------ 不换行的策略: 不换行原理: ul 和 li 默认都是 display:block; 的标签, 可以通过2种方式实现 li 的 不换行显示: * 将 li 设为 display ...

  3. html中写几个li标签,ul标签和li标签 li标签里面能嵌套UL标签吗?

    html中的li和ul是什么标签 ul li 是一个组合:是无序列表标签,在实际中用的非常多, 与之对应的是有序列表:ol li 一个无序列表: 咖啡 茶 牛奶 咖啡 牛奶 茶 咖啡 牛奶 茶 htm ...

  4. 怎么在html中加横条,如何在HTML中插入一行?html横线标签hr全新讲解

    对于刚刚入门的新手不知道如何在HTML中插入一行?那么接下来我们认识一下html横线标签hr. 一:html横线标签hr属性 标签主要是在html中创建水平线,hr是单标签,是没有结束标签的,而且所有 ...

  5. li:nth-child()和 li:nth-of-type()选择器区别

    .demo li:nth-child(2):表示demo下面第二个元素,若此元素不是li,则选择失败. .demo li:nth-of-type(2):表示demo下面第二个li元素. 转载于:htt ...

  6. html获取一条一条的li,html – 在一个li中定位一个span

    我已经设置了一个列表,背景图像设置在每行文本的左侧 虽然他们似乎没有排成一行,但我在文本周围试图重新定位文本,但它似乎没有工作 继承人使用的代码.. One page website with con ...

  7. li标签 常用的CSS设置

    1. li的奇偶数: .item:nth-of-type(odd){奇数} .item:nth-of-type(even){偶数 } 2.选择前几个元素 :nth-child(-n+6){} /*[负 ...

  8. Html中<div></div>标签和<li></li>标签的简单应用

    实现  简单的鼠标的导航渐变 和  简单电器分类页面 我们知道<div></div>标签: <div> 元素是块级元素,它是可用于组合其他 HTML 元素的容器. ...

  9. html ul li 行显示li 间距,[ 求助 ] 让ul li缩小行间距的CSS代码是什么?

    我在网页中插入如下一段RSS阅读器代码: 复制内容到剪贴板 代码: Subscribe to RSS headline updates from: Powered by FeedBurner 可是保存 ...

最新文章

  1. Excel导入异常Cannot get a text value from a numeric cell解决
  2. 使用正则表达式抽取新闻/BBS网页发表时间
  3. 简说创业公司的技术选型,从BearyChat的开发说起
  4. mxnet基础到提高(7)--卷积神经网络基础(2)
  5. 【泰语歌】กลับคำสาหล่า 歌手:Mike Piromporn
  6. 死磕JDK源码之String
  7. 信息学奥赛一本通 提高篇 第6章 平衡树Treap
  8. 《变革中的思索》各路读者评论
  9. 离线下载谷歌浏览器chrome安装包
  10. 递归算法及经典递归例子代码实现
  11. 疫情情况下酒店办理入住流程
  12. MATLAB实现光谱曲线包络线去除,附源代码
  13. 师董正伟:商务部受理微软涉垄断案
  14. 墙裂推荐!B站上的Python学习资源
  15. w7如何关闭计算机防火墙,win7怎么关闭防火墙 win7自带防火墙启用或关闭方法
  16. PTA字符串关键字的散列映射 (哈希表)
  17. Kbuild语法解析
  18. CentOS桌面安装
  19. [蓝桥杯][2015年第六届真题]穿越雷区
  20. Could not resolve all files for configuration “: app: debug Compileclasspath“ mac开发 cordova build踩坑

热门文章

  1. vscode 集成终端改成cmd模式
  2. J2EE总结--浅识JNDI
  3. 黄聪:使用Wordpress中的wpdb类操作数据库
  4. 基础连接已经关闭: 无法连接到远程服务器
  5. linux qt 5移植,Qt 5.13支持处理Lottie文件,可以方便地进行移植
  6. 【学习笔记】34、函数是Python的头等对象
  7. 【转载】SAP表修改概览
  8. 【BOM精讲】BOM 入门基本常识
  9. 一封邮件, 就能看出你是不是足够专业
  10. 46、Power Query-Table.FillDown函数简介