gpt4 book ai didi

HTML/CSS : Common border around overlapping texts

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

如何为此编码?

enter image description here

当我们有这个:
enter image description here

作为

<html>
<head>
<style>
h2
{
letter-spacing:4pt;
font-size:40pt;
color:blue;
text-align:center;
position:absolute;
top:0px;
}
h3
{
letter-spacing:4pt;
font-size:40pt;
color:blue;
text-align:center;
position: absolute;
top:20px;
left:20px;
}
</style>
</head>

<body>
<h2>All right, Mate?</h2>
<h3>All right, Mate?</h3>
</body>
</html>
</html>

...不改变原有的功能/标签。
只增加(或修改)一点。

最佳答案

将其包裹在一个 div 中并设置边框。

尝试将您的 html 更改为:

<div>
<span id="h2">All right, Mate?</span>
<span id="h3">All right, Mate?</span>
</div>​

还有你的 css:

div {
padding : 5px;
border: 3px solid red;
height: 70px;
width: 440px;
}
div span {
width: 420px;
display: block;
letter-spacing:4pt;
font-size:40pt;
color:blue;
position: relative;
}
div span#h2
{
top:0px;
}
div span#h3
{
top:-50px;
left:20px;
}​

fiddle :http://jsfiddle.net/maniator/PJT9V/

关于HTML/CSS : Common border around overlapping texts,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10704790/

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