Html mac和windows FF/Chrome之间具有相同父div的顶部位置绝对不同
我读过不同的人提出的其他解决方案,但都没有回答我的奇怪问题。正如您在绿色文本(Html mac和windows FF/Chrome之间具有相同父div的顶部位置绝对不同,html,css,google-chrome,firefox,cross-browser,Html,Css,Google Chrome,Firefox,Cross Browser,我读过不同的人提出的其他解决方案,但都没有回答我的奇怪问题。正如您在绿色文本(#scroller)上看到的,它是绝对位置,并且具有顶部:173px要查看它与文本的其余部分对齐,我需要将顶部元素放置到top:167px。所以它有6px的差异。我能做些什么来解决这个问题?快疯了 HTML: 只有两件事需要解决 #scroller li { color: #08E700; height: 41px; /* <-- this height was not right, (previous
#scroller
)上看到的,它是绝对位置,并且具有顶部:173px
要查看它与文本的其余部分对齐,我需要将顶部元素放置到top:167px
。所以它有6px的差异。我能做些什么来解决这个问题?快疯了
HTML:
只有两件事需要解决
#scroller li {
color: #08E700;
height: 41px; /* <-- this height was not right, (previous 50) should be same has background line height */
text-align: center;
width: 305px;
}
#scroller {
font-family: helvetica-neue,helvetica,sans-serif;
font-size: 34px;
height: 41px; /* <-- this height was not right, (previous 50) should be same has background line height */
left: 207px;
list-style-type: none;
margin: 0;
overflow: hidden;
position: absolute;
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
text-transform: uppercase;
top: 167px; /* <-- this was : 173px */
z-index: 1;
}
#滚动条李{
颜色:#08E700;
高度:41px;/*为什么不将其与当前存在的
内联?@Vector您的意思是将span元素更改为p元素会成功吗?我不太明白您的意思。@Vector您的意思是将ul#scroller作为内联块插入第一个span中吗?很抱歉,我尝试了您的更改,但是re没有效果。而且,如果这起作用,它应该适用于mac和windows。即使如此,我想理解你的意思,应该与背景线高度相同?我不理解你的意思,背景线高度。你能解释一下吗?
#scroller {
height: 50px;
list-style-type: none;
overflow: hidden;
margin: 0;
position: absolute;
top: 173px;
left: 207px;
z-index: 1;
font-family: helvetica-neue, helvetica, sans-serif;
text-transform: uppercase;
font-size: 34px;
text-shadow: 2px 2px 3px rgba(0,0,0,0.6);
@media #{$ipad-l}{
left: 220px;
}
@media #{$ipad-p}{
left: 150px;
top: 175px;
height: 25px;
font-size: 22px;
}
li{
height: 50px;
text-align: center;
width: 305px;
color:#08E700;
@media #{$ipad-p}{
width: 210px;
}
}
}
#scroller li {
color: #08E700;
height: 41px; /* <-- this height was not right, (previous 50) should be same has background line height */
text-align: center;
width: 305px;
}
#scroller {
font-family: helvetica-neue,helvetica,sans-serif;
font-size: 34px;
height: 41px; /* <-- this height was not right, (previous 50) should be same has background line height */
left: 207px;
list-style-type: none;
margin: 0;
overflow: hidden;
position: absolute;
text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.6);
text-transform: uppercase;
top: 167px; /* <-- this was : 173px */
z-index: 1;
}