gpt4 book ai didi

HTML 按钮垂直对齐

转载 作者:行者123 更新时间:2023-11-28 02:19:30 24 4
gpt4 key购买 nike

我正在尝试设置 CSS 以将链接显示为按钮。

我遇到的问题是每当按钮需要多行文本时,同一行上的其他按钮会稍微降低。

下面的代码;

<html>
<head>
<style>
.pagebutton {
background-color: #0039a6;
color: white;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 20px;
cursor: pointer;
border: 10px solid #0039a6;
border-radius: 16px;
margin:5px;
padding:10px;
width: 200px;
height: 50px;
</style>
</head>
<body>
<a href="https://www.google.com.au" class="pagebutton">Corporate Image Library</a>
<a href="https://www.google.com.au" class="pagebutton">Employee Assistance Program</a>
<a href="https://www.google.com.au" class="pagebutton">Employee Benefits</a>
<a href="https://www.google.com.au" class="pagebutton">Health Site</a>
<a href="https://www.google.com.au" class="pagebutton">News & Announcments</a>
<a href="https://www.google.com.au" class="pagebutton">Social Club Site</a>
<a href="https://www.google.com.au" class="pagebutton">Better Way Suggestions</a>
<a href="https://www.google.com.au" class="pagebutton">Phone Contact List</a>
<a href="https://www.google.com.au" class="pagebutton">Public Website</a>
<a href="https://www.google.com.au" class="pagebutton">Contact Template Procedure Decision Tree</a>
<a href="https://www.google.com.au" class="pagebutton">Whistleblower Integrity Hotline</a>
</body>
</html>

最佳答案

vertical-align 属性设置为 top。 this 的初始值导致多行内联 block 不在同一行上呈现。

关于HTML 按钮垂直对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48292579/

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