垂直对齐动画div

时间:2019-12-03 00:47:45

标签: javascript html css alignment

我有三个按钮,它们在单击时设置了不同的输出文本,并且我试图使用W3.CSS动画将文本“滑入”和滑出。我几乎可以使用两个单独的div来工作,但是无法使它们在按钮下正确对齐;

到目前为止,我已经尝试过floatvertical-align: topdisplay: inline-block和其他一些操作,但是使用它们的方式有误或其他用途(可能是父div样式冲突)?正在引起问题。

Image with a button's output displaying right under the buttons (as it should)

Image with the next button's output displaying lower than the first

我修剪了不相关的代码,同时保留了显示此特定部分的div结构所必需的内容。

JSFiddle link

1 个答案:

答案 0 :(得分:0)

我不确定我是否完全了解您的对齐要求, 但是如果您只是希望div以相同的高度呈现,则可以选择with tf.GradientTape() as tape: loss = tf.math.squared_difference(tf.reduce_sum(model(x_mb)), y_mb) grads = tape.gradient(loss, model.trainable_variables) ,如下所示:

position:absolute
相关问题
最新问题