<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 3 年前。
<分区>
编辑问题以包含 desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem .这将有助于其他人回答问题。
关闭 3 年前。
我有两列文本要对齐。现在我正在考虑一个非常困惑的方法来做这件事并且只使用  
但我知道这不是正确的方法。我希望文本左对齐,而链接与彼此的第一个字母对齐。我提供的这支笔有一个使用空格的例子。
我考虑过使用 <table>
要做到这一点,但我觉得这种方法已经过时了,必须有更好的解决方案。
我也考虑过使用 Flexbox,但我不确定如何使用 Flexbox 实现我想要的效果。
最佳答案
你当然可以使用 <table>
.
<table>
对于本来应该是一张 table 的东西来说,这不是一个过时的解决方案。
所以你的代码看起来像:
td:first-child {
font-weight: 700;
}
<table>
<tr>
<td>Email</td>
<td>contact@email.com</td>
</tr>
<tr>
<td>Github</td>
<td>https://github.com</td>
</tr>
<tr>
<td>LinkedIn</td>
<td>https://linkedin.com</td>
</tr>
</table>
将每行的第一个元素设为粗体。
关于html - 对齐两个不同的段落,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58290729/