![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
HTML+CSS
makarov5
这个作者很懒,什么都没留下…
展开
-
CSS利用a:hover和background-position实现鼠标指向更改图片
#menu a:hover { background-position: bottom;}#menu .home { width: 144px; height: 58px; background: url(images/home.gif) no-repeat; left: 96px; top: 73px;}先规定取图片原创 2016-04-16 16:38:32 · 1413 阅读 · 0 评论 -
float实现横向导航
ul { float:left;//整个列表向左浮动 width:100%; margin:0; padding:0; }a { text-decoration:none; color:#fff; font-size:20px; text-align:center; line-height:1.5em; background-color:#999; border-righ原创 2016-04-24 11:45:05 · 430 阅读 · 0 评论 -
火狐不兼容<hr>标签的解决方法
使用只有一边边框的div替代标签.divhr {border-top-width: 2px;border-top-style: solid;border-top-color: #987cb9;width:100%;margin-top:40px;}使用margin-top调整位置原创 2016-05-21 15:08:51 · 462 阅读 · 0 评论 -
使两个元素重叠的方法,附带按钮搜索框的实例
父元素设置为相对定位,这样子元素绝对定位的起点为父元素的左上角,将子元素设置为绝对定位,可以无视父元素内其他元素定位。带按钮搜索框的实例:html: CSS:#searchdiv { width: 130px; height: 28px; margin:30px 45px; position:relative;//父div}#search原创 2016-05-21 16:08:00 · 3086 阅读 · 0 评论 -
CSS将超出的文本以省略号显示
对div或者span同时应用Css:text-overflow:ellipsis; //超出的用...实现white-space:nowrap; //禁止换行overflow:hidden; //超出隐藏当然了你的页面元素要设置固定的宽度,超出了宽度才会显示。如果是 a 标签还要另加上display:block;转载 2016-05-21 17:15:58 · 336 阅读 · 0 评论