div展示html文本,html – 使文本适合div

博主正在尝试重建其90年代父亲的网站,并遇到了文本不适合div及水平对齐的问题。通过提供的HTML与CSS代码示例,博主希望解决布局难题,使文本能够正确显示在同一div内。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我一直在努力重新创建我在90年代创建的父亲网站(呃),我一直无法让文本适合div内部并水平对齐.我需要将文本放在一起,以便它们适合div.这是

jsfiddle中页面的代码

示例HTML

new%20logo.jpg

示例CSS

div img#header{

width: 50%;

height: 15%;

margin-left: 125px;

margin-right: auto;

}center input#search{

width: 300px;

height: 45px;

border: solid 1px black;

margin-top: 55px;

font-size: 25px;

}center button#searchbutt{

border: solid 1px black;

width: 65px;

height: 30px;

}#searchbutt:hover{

color: #FFF;

background-color: #000;

}#searchbutt{

background-color: #FFF;

color: #000;

}#links{

height: 40px;

width: 100%;

text-align: center;

line-height: 40px;

}.home{

width: 80px;

text-align: center;

height: 40px;

background-color: white;

color: black;

padding-left: auto;

padding-right: auto;

display: inline-block;

border: solid 1px black;

vertical-align: middle;

}.DL{

width: 95;

text-decoration: none;

text-align: center;

height: 40px;

background-color: white;

color: black;

padding-left: auto;

padding-right: auto;

display: inline-block;

border: solid 1px black;

}.home a{

text-decoration: none;

color: gray;

}.DL a{

text-decoration: none;

color: gray;

}div center a#DLbutt{

border: solid 1px black;

width: 100px;

height: 50px;

background-color: black;

}div center a#DLbutt{

text-decoration: none;

color: gray;

}#download{

padding-top: 30px;

}html{

background-image: url("watermark.gif");

}.home a span{

position:absolute;

width:100%;

height:100%;

top:0;

left: 0;

display: inline-block;

vertical-align: middle;

line-height: normal;

}

我需要“我们的使命部分”在同一个div中.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值