如何将css的背景颜色设置为无色

html-css012

如何将css的背景颜色设置为无色,第1张

css的背景颜色设置为无色步骤如下:

1、新建一个html文件,需要设置宽度250px和高度140px,以及背景色填充为红色。

2、然后在父级DIV中插入一个子DIV,定义它的宽200px,高90px,以及背景色。

3、然后添加一个无色(透明)的代码(opacity:0.6)。

4、在图层的上方,有个不透明度,设置为60%。

5、把刚才的背景色和无色代码删除,换个代码【background-color:rgba(255,255,255,0.6)】。

6、其中255,255,255就是PS中的拾色器里的数值。这样,css的背景颜色就为无色了。

不用太麻烦

td1{

background-image:url('img/menu_on.gif')

color:#FFFFFF

float:left

width:100px

height:35px

text-align:center

}

td1a{

color:#FFFFFF

line-height:35px

}

如果要清楚链接的下划线,那就再加个text-decoration:none

布局为

文字

或者是

文字

回答于 2022-12-08 抢首赞 已踩 0 查看全部1个回答 — 为你推荐更多精彩内容 — 正在加载 加载失败 点击重新加载

微信

微博

QQ

QQ空间

答案纠错

举报

取消 赞赏答主 5 10 50 100 200

已赞赏0财富值

合计:0 财富值

登录后赞赏 选择举报类型 侵犯版权 色情低俗 涉嫌违法犯罪 时政信息不实 垃圾广告 低质灌水 工作人员会在48小时内处理,处理结果请关注系统通知,感谢您对百度知道的支持。 确定 void function(a,b,c,d,e,f){function g(b){a.attachEvent?a.attachEvent("onload",b,!1):a.addEventListener&&a.addEventListener("load",b)}function h(a,c,d){d=d||15var e=new Datee.setTime((new Date).getTime()+1e3*d),b.cookie=a+"="+escape(c)+"path=/expires="+e.toGMTString()}function i(a){var c=b.cookie.match(new RegExp("(^| )"+a+"=([^]*)(|$)"))return null!=c?unescape(c[2]):null}function j(){var a=i("PMS_JT")if(a){h("PMS_JT","",-1)try{a=a.match(/{["']s["']:(\d+),["']r["']:["']([\s\S]+)["']}/),a=a&&a[1]&&a[2]?{s:parseInt(a[1]),r:a[2]}:{}}catch(c){a={}}a.r&&b.referrer.replace(/#.*/,"")!=a.r||alog("speed.set","wt",a.s)}}if(a.alogObjectConfig){var k=a.alogObjectConfig.sample,l=a.alogObjectConfig.randd="https:"===a.location.protocol?"https://fex.bdstatic.com"+d:"http://fex.bdstatic.com"+d,k&&l&&l>k||(g(function(){alog("speed.set","lt",+new Date),e=b.createElement(c),e.async=!0,e.src=d+"?v="+~(new Date/864e5)+~(new Date/864e5),f=b.getElementsByTagName(c)[0],f.parentNode.insertBefore(e,f)}),j())}}(window,document,"script","/hunter/alog/dp.mobile.min.js") window.tt = 1676996378

方法如下:

取消a标签在移动端点击时的蓝色:

-webkit-tap-highlight-color: rgba(255, 255, 255, 0)

-webkit-user-select: none

-moz-user-focus: none

-moz-user-select: none

使用图片作为a标签的点击按钮时,当触发touchstart的时候,往往会有一个灰色的背景:

a,a:hover,a:active,a:visited,a:link,a:focus{

-webkit-tap-highlight-color:rgba(0,0,0,0)

-webkit-tap-highlight-color: transparent

outline:none

background: none

text-decoration: none

}

改变选中内容的背景颜色:

::selection {

background: #FFF

color: #333

}

::-moz-selection {

background: #FFF

color: #333

}

::-webkit-selection {

background: #FFF

color: #333

}

去除ios input框点击时的灰色背景:

-webkit-tap-highlight-color:rgba(0,0,0,0)