HTML写了一个普通的列表
因为最后一个按钮多一个字的原因,要修改使最后一个按钮的padding有别于其他的padding,我的解决方法是给他们分别添加不同的class(请问有什么其他更好的解决方法吗?),3字的是.3t
,4字的是.4t
。
.major { padding-top: 30px; } .buttons { height: 350px; padding-top: 20px; /*display: flex; flex-direction: column; align-items: center; justify-content: center;*/ } .buttonsss { /*display: flex; flex-direction: row; align-items: center; justify-content: center;*/ margin-left: auto; margin-right: auto; } .buttonsss li { background-color: transparent; border: 1px #939393 solid; border-radius: 4px; font-size: 20px; color: #939393; width: 150px; height: 146px; line-height: 40px; text-align: center; list-style-type: none; text-decoration: none; cursor: pointer; margin-right: 30px; display: inline; } .buttonsss a:link { text-decoration: none; border-bottom-width: 0; } .buttonsss li:hover { color: #a8d970; cursor: pointer; border: 1px #a8d970 solid; } .container p { padding-bottom: 70px; } .4t { padding: 10px 10px; } .3t { padding: 10px 20px; }
但是....无效...没有padding效果
如果padding写在.buttonsss li
里就没问题
请问是为什么?
ul 下面 怎么直接是 a 标签
Class Name不能是数字开头啊,把3t和4t换个英文名就行了
...问题很多,建议先学好基本...
可以去W3C学习下 http://www.w3school.com.cn/
各种毛病啊…
话说为什么把<li>嵌套在里面?
注意命名规范,不要用数字开头,以字母,$,_打头
是的我会告诉你css明明不能以数字开头吗?
改成_3t _4t试试吧。