Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 设置宽度时,Flex未正确对齐_Css_Flexbox_Tailwind Css - Fatal编程技术网

Css 设置宽度时,Flex未正确对齐

Css 设置宽度时,Flex未正确对齐,css,flexbox,tailwind-css,Css,Flexbox,Tailwind Css,我有一支顺风笔 1. 9:00 12 19:00 我左边的项目符号不会设置相同的宽度。我给了他们2.5rem的宽度,但是浏览器计算的宽度在px中是不同的。有人知道我怎样才能把所有的东西都对齐吗。因为当我有一个很长的列表时,我想将文本对齐在中间。或者有更好的解决方案 问题在于flexbox属性,第一个内容“第一步使用flex”的宽度比第二个内容“如何正确对齐项目符号点”的宽度小,因此flex缩小了第二个内容的宽度,以将此100%的应用宽度固定到h4标签上 <ul class="

我有一支顺风笔

  • 1. 9:00
  • 12 19:00
我左边的项目符号不会设置相同的宽度。我给了他们2.5rem的宽度,但是浏览器计算的宽度在px中是不同的。有人知道我怎样才能把所有的东西都对齐吗。因为当我有一个很长的列表时,我想将文本对齐在中间。或者有更好的解决方案


问题在于flexbox属性,第一个内容“第一步使用flex”的宽度比第二个内容“如何正确对齐项目符号点”的宽度小,因此flex缩小了第二个内容的宽度,以将此100%的应用宽度固定到h4标签上

<ul class="max-w-xs w-full list-reset">
    <li class="flex border-b-2 border-dashed py-2">
        <div class="w-8">1</div>

        <h4 class="w-full">
            <a href="#" class="text-black no-underline hover:underline">First steps with flex</a>
        </h4>

        <span class="ml-auto">9:00</span>
    </li>

    <li class="flex border-b-2 border-dashed py-2">
        <div class="w-8">12</div>

        <h4 class="w-full">
            <a href="#" class="text-black no-underline hover:underline">How to align the bullets points correct</a>
        </h4>

        <span class="ml-left">19:00</span>
    </li>
</ul>
  • 1. 9:00
  • 12 19:00

<ul class="max-w-xs w-full list-reset">
    <li class="flex border-b-2 border-dashed py-2">
        <div class="w-8">1</div>

        <h4 class="w-full">
            <a href="#" class="text-black no-underline hover:underline">First steps with flex</a>
        </h4>

        <span class="ml-auto">9:00</span>
    </li>

    <li class="flex border-b-2 border-dashed py-2">
        <div class="w-8">12</div>

        <h4 class="w-full">
            <a href="#" class="text-black no-underline hover:underline">How to align the bullets points correct</a>
        </h4>

        <span class="ml-left">19:00</span>
    </li>
</ul>