如何使用calc()获取此元素的当前高度?

我在另一个div内有一个div。

我想把里面的东西垂直放在中间。

我可以用这种方式实现它:

class Someclass:
    def __init__(self):
        self.some_dict = defaultdict(lambda: None)

    def generate(self):
        <some code>

def some_method_to_parallelize(x: Someclass):
    <some code>

def some_method():
    max_workers = round(os.cpu_count() // 1.5)
    invocations_per_process = 100
    with ProcesspoolExecutor(max_workers=max_workers) as executor:    
        data = [executor.submit(some_method_to_parallelize,Someclass())] for _ in range(invocations_per_process)]
        data = list(itertools.chain.from_iterable([r.result() for r in data]))
    

但是,有时内盒的高度可变,因此我想使用以下内容:

calc(50% - 100px ) /* if the height of the inside box is 100px */

我尝试了许多方法,但无法成功。就像下面的图片一样。应该将其放置在两个厚实的笔尖之间的中间。

如何使用calc()获取此元素的当前高度?

我可以知道如何在calc(50% - height ) calc(50% - attr(height) ) calc(50% - this(height) ) 函数中检索高度值吗?

更新:我根据jsotola的评论进行了尝试。但它表示该属性值无效。

如何使用calc()获取此元素的当前高度?

谢谢

a9165477 回答:如何使用calc()获取此元素的当前高度?

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/1298535.html

大家都在问