2

我很难在文本下方的线上制作边框半径,而且我也有关于如何在文本和底线之间放置间距的问题。这是我的预期输出

预期输出-> https://ibb.co/RSKytWm

代码笔 ->代码笔

代码

<div class="
    min-h-screen
    flex
    items-center
    justify-center
    py-4
    px-4
    sm:px-6
    lg:px-6
    bg-black
  ">
  <div class="max-w-lg w-full space-y-8">
    <div class="flex flex-col w-full px-4 py-4 sm:px-6 md:px-8">
      <div class="flex flex-row justify-center">
        <button class="
                  inline-flex
                  items-end
                  justify-center
                  h-20
                  w-28
                  text-white
                  font-regular
                  border-b-4 border-white
                  rounded-3xl
                ">
          Personal Details
        </button>
        <button class="

                  inline-flex
                  items-end
                  justify-center
                  h-20
                  w-28
                  text-white
                  font-regular
                  border-b-4 border-white
                  rounded-3xl
                        mr-10
                  ml-10
                ">
          Contact Details
        </button>
        <button class="
                  inline-flex
                  items-end
                  justify-center
                  h-20
                  w-28
                  text-white
                  font-regular
                  border-b-4 border-white
                  rounded-3xl
                ">
          Other Details
        </button>
      </div>
    </div>
  </div>

</div>

4

1 回答 1

0

更新:

和OP讨论了很久,OP注意到上面没有弯曲(反正我没注意到),如下:

预览

即使添加rounded-t-sm也无法解决它,因为这是无法解决的,因为我们正在添加bottom-border到按钮,解决的唯一方法是删除bottom-border并添加<hr>并将其样式设置为看起来像线。

更新代码:

<div class="min-h-screen flex items-center justify-center py-4 px-4 sm:px-6 lg:px-6 bg-black">
    <div class="max-w-lg w-full space-y-8">
        <div class="flex flex-col w-full px-4 py-4 sm:px-6 md:px-8">
            <div class="flex flex-row justify-center">
                <button class="inline-flex flex-col items-end justify-center h-50 w-50 rounded-sm text-white font-regular">
                    Personal Details
                    <hr class="w-full border-white rounded-md border-2 mt-2" />
                </button>
                <button class="inline-flex flex-col items-end justify-center h-50 w-50 rounded-sm text-white font-regular mr-10 ml-10">
                    Contact Details
                    <hr class="w-full border-white rounded-md border-2 mt-2" />
                </button>
                <button class="inline-flex flex-col items-end justify-center h-50 w-50 rounded-sm text-white font-regular">
                    Other Details
                    <hr class="w-full border-white rounded-md border-2 mt-2" />
                </button>
                
            </div>
        </div>
    </div>
</div>

更新结果:

预览

操场

旧答案

不知道你添加的困难是什么border-radius,尝试添加rounded-sm它会起作用。

如果您想在文本和行之间添加一些空格,请尝试padding在按钮上添加一些空格,我认为这py-2将满足您的需求。

代码:

<div class="min-h-screen flex items-center justify-center py-4 px-4 sm:px-6 lg:px-6 bg-black">
    <div class="max-w-lg w-full space-y-8">
        <div class="flex flex-col w-full px-4 py-4 sm:px-6 md:px-8">
            <div class="flex flex-row justify-center">
                <button class="inline-flex items-end justify-center h-50 w-50 py-2 rounded-sm text-white font-regular border-b-4 border-white">
                    Personal Details
                </button>
                <button class="inline-flex items-end justify-center h-50 w-50 py-2 rounded-sm text-white font-regular border-b-4 border-white mr-10 ml-10">
                    Contact Details
                </button>
                <button class="inline-flex items-end justify-center h-50 w-50 py-2 rounded-sm text-white font-regular border-b-4 border-white">
                    Other Details
                </button>
            </div>
        </div>
    </div>
</div>

结果:

预览

操场

于 2021-09-10T15:07:07.553 回答