我有以下代码,该代码创建了两个< p>存储一些文本的标签:
<p v-if="my_property <= 0" class="text-green-500 text-lg font-bold">{{Math.abs(my_value)}}%</p>
<p v-else class="text-red-500 text-lg font-bold">{{my_value}}%</p>
<div class="inline-block align-bottom bg-yellow-500 align-text-bottom">
<p class="text-gray-500 text-sm ml-1 inline-block align-text-bottom align-bottom">tsa</p>
</div>
我正在尝试拥有最后一个&lt; p&gt;与第一个相比,标签对齐底部。我已经尝试放置&lt; p&gt;当前在&lt; div&gt;内外A&lt; div&gt;标签,但我似乎无法正确地找到结果,目前看起来像这样:
我希望“ tsa”文本出现在这里:
我需要改变我目前得到的方式吗?
注意:我已经强调了&lt; div&gt;在黄色中仅显示文本不与底部保持一致。
I have the following code that creates two <p> tags to store some text:
<p v-if="my_property <= 0" class="text-green-500 text-lg font-bold">{{Math.abs(my_value)}}%</p>
<p v-else class="text-red-500 text-lg font-bold">{{my_value}}%</p>
<div class="inline-block align-bottom bg-yellow-500 align-text-bottom">
<p class="text-gray-500 text-sm ml-1 inline-block align-text-bottom align-bottom">tsa</p>
</div>
I'm trying to have the last <p> tag align bottom as compared to the first. I've tried putting the <p> tag currently in the <div> inside and outside a <div> tag, but I can't seem to get the result right, and it currently looks like this:
I want the "tsa" text to appear here:
What do I need to change about the way I've currently got it?
Note: I've highlighted the <div> in yellow to just show the text is not aligned to the bottom of it.
发布评论
评论(2)
您可以通过为所有
&lt; p&gt;
标签添加flex-container来解决问题。You can solve your issue by adding a flex-container for all your
<p>
tags.您可以按照以下代码获取解决方案
You can follow the below code for the solution