gpt4 book ai didi

css - 是否可以排列不同类型的列表项,即图像和按钮?

转载 作者:太空宇宙 更新时间:2023-11-04 03:32:16 25 4
gpt4 key购买 nike

我正在尝试重新创建 Google 主页,但在排列右上角菜单中的元素时遇到问题?

我尝试了 text-align,但似乎没有任何作用。

如有任何帮助,我们将不胜感激!

#wrapper {
position: absolute;
top: -100px;
left: 450px;
height: 500px;
width: 600px;
}
ul {
position: absolute;
right: 60px;
width: 400px;
height: 200px;
display: inline;
line-height: 10px;
list-style-type: none;
font-family: Arial, sans-serif;
margin-top: 30px;
}
li {
display: inline;
padding-right: 10px;
text-decoration: none;
font-size: 13px;
vertical-align: top;
}
a:link {
color: #000;
}
#picture_menu {
position: absolute;
right: 60px;
line-height: 40px;
width: 200px;
top: 10px;
}
#share {
border: 1px solid #dcdcdc;
color: #444!important;
background: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1);
}
#header {
position: absolute;
top: 280px;
left: 210px;
background-image: url("images/logo.png");
height: 200px;
width: 400px;
background-repeat: no-repeat;
}
#searchbar {
position: absolute;
top: 400px;
left: 50px;
width: 600px;
height: 30px;
}
#microphone {
position: absolute;
top: 405px;
left: 625px;
background: url('images/microphone.png') no-repeat;
height: 50px;
width: 50px;
}
#search_button {
position: absolute;
top: 450px;
left: 230px;
border: 1px solid #dcdcdc;
border-color: rgba(0, 0, 0, 0.1);
color: #444!important;
font-size: 11px;
font-weight: bold;
padding: 10px;
background: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1);
}
#lucky_button {
position: absolute;
top: 450px;
left: 350px;
border: 1px solid #dcdcdc;
border-color: rgba(0, 0, 0, 0.1);
color: #444!important;
font-size: 11px;
font-weight: bold;
padding: 10px;
background: -webkit-linear-gradient(top, #f5f5f5, #f1f1f1);
}
#tag_text {
background: url(images/mountains.png) no-repeat;
background-position: left;
padding-left: 40px;
position: absolute;
top: 500px;
left: 140px;
}
#tag_text span {
color: red;
}
#tag_text a:link {
color: blue;
}
p {
font-family: arial;
}
#footer {
position: absolute;
bottom: 0px;
width: 100%;
height: 30px;
background: #f2f2f2;
border-top: 1px solid #e4e4e4;
}
<ul>
<li>
<a href="#+Adam">+Adam</a>
</li>
<li>
<a href="#gmail">Gmail</a>
</li>
<li>
<a href="#images">Images</a>
</li>
<li>
<img src="http://i.imgur.com/e2Wyc6B.png">
</li>
<li>
<img src="http://i.imgur.com/0Xtg2MN.png">
</li>
<li>
<input type="button" value="Share" id="share" />
</li>
<li>
<img src="http://i.imgur.com/6ku5ORI.png">
</li>
</ul>

最佳答案

我已经为您的问题创建了一个 JSFiddle,您可以在这里找到它:JSFiddle
我也把li的 display: inline改成了display: inline-block,你可以试试改变padding来得到正确的结果..

关于css - 是否可以排列不同类型的列表项,即图像和按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26150170/

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