CSS怎样去除列表默认的边距?

html-css015

CSS怎样去除列表默认的边距?,第1张

可以尝试以下初始化代码:

body,div,ol,ul,li,dl,dt,dd,h1,h2,h3,h4,h5,h6,p,form,fieldset,legend,input{ margin:0padding:0}

h1,h2,h3,h4,h5,h6{ font-size:100%font-weight:normal}

ol,ul{ list-style:none}

img,fieldset{ border:0 nonedisplay:block}

由于各个版本的浏览器,对一些标签的初始值不一样,我们需要帮它们初始化成一样的,用于兼容各个版本的浏览器。

手机设备下的界面

正常浏览器下的html5界面

要解决该问题需要加入一些css样式,如下:

input[type="button"], input[type="submit"], input[type="reset"] {

-webkit-appearance: none

-moz-appearance: none

appearance: none

}

如果还有圆角的问题,

.button{ border-radius: 0}

在写表单时候会发现一些浏览器对表单赋了默认的样式,如在谷歌浏览器下,文本框和下拉选择框当载入焦点时,会出现发光的边框!文本框textarea可以自由拖拽拉大!在IE10下,文本框输入内容后,会在右侧出现一个小叉叉。面对这些问题,下面来看看解决方法。

去除谷歌等浏览器文本框默认发光边框

input:focus, textarea:focus {

outline: none

}

去掉高光样式:

input:focus{

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

-webkit-user-modify:read-write-plaintext-only

}

也可以重新根据自己的需要设置一下,如:

input:focus,textarea:focus {

outline: none

border: 1px solid #f60

}

这样的话,当文本框载入焦点时,边框颜色就会变为橙色,增强用户体验!

去除IE10+浏览器文本框后面的小叉叉

input::-ms-clear {

display: none

}

禁止多行文本框textarea拖拽

添加属性多行文本框就不能拖拽放大缩小了:

textarea {

resize: none

}

不用太麻烦

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 = 1676980901