Html中button标签设置background问题
来源:互联网 发布:766冒险岛数据库进不了 编辑:程序博客网 时间:2024/06/06 09:50
在设置button的background样式时,会出现如下问题
<html><head><style type="text/css"> .b{ width:100px; height:200px; background: #ff0000 url(/i/eg_bg_03.gif) no-repeat fixed center; }</style></head><body><p>下面是按钮</p><button class="b"></button><p>.......</p><p>.......</p><p>.......</p></body></html>
将上述代码复制粘贴到这里,开始代码测试。
按钮背景图片没有正常显示,这是为什么?
我们来看一下CSS背景设置的每个参数含义
CSS 背景属性(Background)
background 是下面几种的合集
当我们去掉 no-repeat时可以正常显示,图片,当按钮尺寸大于背景图片大小时,背景图片是重复的将按钮铺满。
这不是我们想要的效果,因此
我继续使用排除法,去掉fixed, 图片可以正常显示了。
问题出在,
no-repeat 与 fixed 不能同时设置。并且 no-repeat 与 inherit也不能同时设置。
0 0
- Html中button标签设置background问题
- HTML中button标签通过CSS设置样式
- html中background-image属性的设置
- html中background-image属性的设置
- HTML页面 button 标签 刷新页面问题
- HTML语言button标签type属性问题
- 标签设置background-image
- a标签设置background url出现的问题
- HTML <button> 标签
- Html Button标签默认值
- HTML <button> 标签
- html button标签
- Android开发设置Button的background
- android Button如何用代码设置background
- android 使用.9图片的background的button的text设置问题
- 解决给一组Button设置Background导致点击效果错乱问题
- 解决 Button 设置 background 之后点击动画效果消失的问题
- HTML中<button>与<input>标签的区别
- YII相关资料(干货)
- GNU awk命令用法详解
- hdu3038带权并查集
- 用tensorflow实现seq2seq模型
- html5页面分屏 还有上下拖动
- Html中button标签设置background问题
- UML—— 概述
- express框架下index.js和index.ejs的注释版
- Json转换利器Gson之实例三-Map处理(上)
- 谈谈Java中的语法糖
- 关系数据模型和关系数据库系统
- 学习JavaScript中的异步Generator
- Codewars --Number of trailing zeros of N!
- css rem 的理解