记录写demo今天踩的坑
起因是这样的
由于写demo要引入一个reset.css文件,然后我好像就随手在网上找了个reset样式表。
然后就出现了这个情况
就像图片那样
我发现列表中的文字全部跑到右边了
我的第一反映当然是以为没有清楚浮动。然后把它的父标签清楚浮动,却没有起到作用
也想到了reset样式表中的float属性,但都没有float:right的属性啊
直接崩溃┭┮﹏┭┮
直到我再看看之前哥发的消息
原来这一直就是一个文字的位置的问题,并不是浮动问题(我想多了)
然后,终于在reset样式表中找到了罪魁祸首(╯▔皿▔)╯
然后改了text-align属性,终于达到自己想要的效果了
所以吃了个教训,千万别在网上随便找reset样式表A,最后配上雅虎yui
`/
TODO will need to remove settings on HTML since we can’t namespace it.
TODO with the prefix, should I group by selector or property for weight savings?
/
* {
text-decoration: none;
}
html {
color: #000;
background: #FFF;
}
/
TODO remove settings on BODY since we can’t namespace it.
/
/
TODO test putting a class on HEAD.
- Fails on FF.
/
body,
div,
dl,
dt,
dd,
ul,
ol,
li,
h1,
h2,
h3,
h4,
h5,
h6,
pre,
code,
form,
fieldset,
legend,
input,
textarea,
p,
blockquote,
th,
td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
fieldset,
img {
border: 0;
}
/
TODO think about hanlding inheritence differently, maybe letting IE6 fail a bit…
/
address,
caption,
cite,
code,
dfn,
em,
strong,
th,
var {
font-style: normal;
font-weight: normal;
}
ol,
ul {
list-style: none;
}
caption,
th {
text-align: left;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
font-weight: normal;
}
q:before,
q:after {
content: ‘’;
}
abbr,
acronym {
border: 0;
font-variant: normal;
}
/ to preserve line-height and selector appearance /
sup {
vertical-align: text-top;
}
sub {
vertical-align: text-bottom;
}
input,
textarea,
select {
font-family: inherit;
font-size: inherit;
font-weight: inherit;
font-size: 100%;
/to enable resizing for IE*/
}
/because legend doesn’t inherit in IE /
legend {
color: #000;
}`
这是Web课程得作业吗?
不是的,自己找的练习