gpt4 book ai didi

css - 鼠标悬停在列表项上摇动

转载 作者:行者123 更新时间:2023-12-02 22:19:22 25 4
gpt4 key购买 nike

当我将鼠标悬停在 上的列表项上时如何防止晃动 here ?到目前为止,我已经尝试过不同的边距和填充。我还检查了哪个 css 元素溢出,但我找不到任何结果。

我的 CSS 在这里:

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
background:#000000;
color:#fff;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}


.temizle{clear:both;}

#containerANA{
width:1100px;
height:auto;
margin: 0 auto;
font:10px arial, helvetica, Geneva, sans-serif;

}


#content{
width:100%;
margin-top:0px;
}


#content p{
position: relative;
margin-left:auto;
margin-right:auto;
top:0px;
display: block;
padding: 5px;
color: #769B4E;
font-size:18px;
font-family: arial, helvetica, Geneva, sans-serif;
text-align:justify;
border: 0px solid #769B4E;
margin-top: 10px;
margin-bottom: 10px;
}

#content p a{
color:#ccc;
text-decoration:none;
}

#content p a:hover{
background:#e5da5f;
color:#000;
}



.ikinciSol{
width:550px;
height:auto;
float:left;
margin-right:0px;
font-family:Verdana, Geneva, sans-serif;
text-align:left;
}

.ikinciSol h1{
font-weight:bold;
text-decoration:none;
font-size:14px;
font-family:Verdana, Geneva, sans-serif;
color:#fb891a;
}

.ikinciSol ul
{
list-style-type: none;

}

.ikinciSol #playlist li {
margin-left:50px;
}

.ikinciSol ul li .singer{
font-size:18px;
display:inline;
}

.ikinciSol ul li .song{
font-size:14px;
display:inline;
}

.ikinciSol ul li a{
text-decoration:none;
color:#fff;
margin-right:5px;

}

.ikinciSol ul li .singer a:hover{
background:#e5da5f;
color:#000;
}

.ikinciSol ul li .song a:hover{
background:#FF9966;
color:#000;
}

.artist_track{
margin-right:12px;

}
.fav{

}



.ilgiliOge{
width:402px;
height:306px;
font-size:24px;
padding:0px;
}

最佳答案

问题是,当您悬停鼠标时,<li> 的高度由于共享按钮而发生变化。为了防止这种情况发生,你应该给一个 min-height到列表项。最重要的是,如果你想让文本相对于你的按钮居中,你还应该给它一个line-height。还有一些调整。

CSS 代码:

.ikinciSol #playlist li {
min-height:40px;
line-height:40px;
}
.ikinciSol #playlist li .fav a {
position:relative;
top:5px;
}

JSFiddle 链接:http://jsfiddle.net/vZnFF/

PS:您不应该在列表项之间添加分隔符。PS2:您可以只使用 CSS 来实现同样的 :hover 效果。

关于css - 鼠标悬停在列表项上摇动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13982023/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com