gpt4 book ai didi

html - CSS 截断了我的图像

转载 作者:行者123 更新时间:2023-11-28 10:50:29 27 4
gpt4 key购买 nike

该站点应如下所示: http://funedit.com/imgedit/soubory/small_17663057361396452975.jpg

但它实际上看起来像: http://funedit.com/andurit/ (它剪切了该警告图像并将其移动到左侧而不是右侧。

谁能帮我解释一下我做错了什么,我是 CSS 新手

我的 HTML:

 <body> 
<div class="top-panel">
<div id="center"> <a class="top-button" href="#"></a>
<span class="text">Prave hraje <b>5000</b> hracov na <b>150</b> serveroch!</span>
<span class="panel">Registruj sa zdarma nebo</span>
<input type="text">
<input type="text">
<input type="image" id="login-button" src="images/login_button.png" alt="Submit">
<div class="tournament"> Night Cup 2014 - Sledujte priamy prenos! </div>
</div>
</div>
</body>

我的 CSS:

body {
background-image:url('images/background.png');
background-color:#cccccc;
margin: 0 auto;
}
#center {
width: 1030px;
margin: 0 auto;
/*display: inline-block; */
}
.top-panel {
background-image: url("images/top_panel.png");
background-repeat: repeat-x;
background-position: center;
height: 43px;
padding-top:5px;
display: block;
}
a.top-button {
background-image: url("images/top_button.png");
height: 37px;
width: 141px;
background-repeat: no-repeat;
display: inline-block;
margin-left: 50px;
}
.text {
color: #9c9c9c;
padding: 0px 10px;
}
.panel {
color: #6ab1ed;
padding: 0px 350px;
display: inline-block;
}
input{
vertical-align:top;
display: inline-block;
height: 25px;
line-height: 25px;
text-align: center;
position: relative; left: 510px; top: 2px;
}
span{
position: absolute;
display: inline-block;
height: 35px;
line-height: 35px;
text-align: center;
}
span b{
font-weight:bold;
}
#login-button{
/*background-image: url("images/login_button.png"); uz je to v HTML*/
height: 27px;
width: 81px;
line-height: 27px;
display: inline-block;
position: relative; left: 510px; top: 4px;
}
.tournament{
background-image: url("images/warning.png");
background-repeat: no-repeat;
text-align: right;
display: block;
color: #d4d4d4;
}

最佳答案

您正在将图像设置为背景图像。虽然“文本对齐”确实将文本向右移动,但背景图像不受此影响。

把代码改成:

<div class="tournament"
<img src="..." />
Night Cup 2014 - Sledujte priamz prenos!
</div>

所以它会与文本对齐。

关于html - CSS 截断了我的图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22816467/

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