我有一个引导程序panel
,当我将鼠标悬停在它上面时,我希望border
和panel-heading
的{{1}}更改。
我可以更改background-color
颜色,但有没有办法让面板border
也能改变?
这里需要某种筑巢吗?
background-color
答案 0 :(得分:1)
您必须panel
panel-heading
然后定位孩子.panel-default > .panel-heading {
background-color: #16749F;
color: #ddd;
}
.panel:hover > .panel-heading {
background: red;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Panel content
</div>
</div>
def multilayer_perceptron(x, weights, biases):
:
:
pred = multilayer_perceptron(x, weights, biases)
:
:
with tf.Session() as sess:
sess.run(init)
:
correct_prediction = tf.equal(tf.argmax(pred, 1), tf.argmax(y, 1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, "float"))
print ("Accuracy:", accuracy.eval({x: X_test, y: y_test_onehot}))
答案 1 :(得分:1)
.panel-default:hover > .panel-heading {
background-color: grey;
}
这意味着:如果您将鼠标悬停在.panel-default
,则.panel-heading
的背景颜色将变为灰色。
答案 2 :(得分:0)
这是可能的,而且很容易。
CSS:
.panel:hover .panel-heading {
border: 1px solid grey;
}
当您将鼠标悬停在面板上时,此代码会更改面板标题边框。记住CSS特性并正确覆盖Bootstrap的CSS。