gpt4 book ai didi

html - 如何将所有对象对齐在同一行

转载 作者:行者123 更新时间:2023-12-04 16:23:18 25 4
gpt4 key购买 nike

我正在尝试边界半径形状,但圆形与其他形状不在同一条线上,这正常吗?我怎样才能把它放在同一行

代码笔:https://codepen.io/Kamy7/pen/GREQWrW

编辑:那是我忘记的 html我必须输入更多的单词才能保存它lol

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<div>
<p class="rounded-edges">Rounded Edges</p>
<p class="circle-shape">Circle Shape</p>
<p class="top-bottom">Rounded top, bottom</p>
<p class="bottom-top">Rounded bottom, top</p>
</div>
</body>
</html>
body {
font-family: Arial;
font-weight: bold;
color: #F2EA01;
}

.rounded-edges {
width: 100px;
height:100px;
background: black;
padding: 20px;
border-radius: 25px;
text-align: center;
display: inline-block;
}

.circle-shape {
width: 100px;
height:100px;
background: black;
padding: 20px;
border-radius: 50%;
text-align: center;
display: inline-block;
}

.top-bottom {
width: 100px;
height:100px;
background: black;
padding: 20px;
border-radius: 25px 0px 25px;
text-align: center;
display: inline-block;
}

.bottom-top {
width: 100px;
height:100px;
background: black;
padding: 20px;
border-radius: 0px 25px 0px;
text-align: center;
display: inline-block;
}

最佳答案

只需将 display: flex; 添加到包含所有形状的 div 中。它甚至可以使用 1 个字母

关于html - 如何将所有对象对齐在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69276955/

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