I am using this class inside a div :
我在div中使用这个类:
.successful {
width: 100%;
background-color: #c2f5b2;
border: solid 1px #89bc79;
color: #29ac00;
padding: .5% 1%;
margin: 1% 0;
display: block;}
the div goes like
div就像
<div class="successful"></div>
when i remove the content, the div still shows a green patch. i want the whole div to disappear. i used display=table
inside the class successfully. it goes fine for forefox, not for chrome. pls help.
当我删除内容时,div仍显示绿色补丁。我希望整个div消失。我成功地在类中使用了display = table。它对于forefox来说很好,而不是用于chrome。请帮助。
6 个解决方案
#2
2
Use
使用
style='display:none;'
after deleting.
删除后。
#3
2
use jquery on deletion activity and hide or display none that dive.
在删除活动上使用jquery并隐藏或显示没有潜水。
style='display:none;'
or use like
或使用像
$('any activity at which you want to delete the div').click(function() {
$('.successful').css('display','none');
});
});
#4
1
You either need to use javascript
or jQuery
to solve this.
你需要使用javascript或jQuery来解决这个问题。
Here is an example using jQuery.
这是一个使用jQuery的例子。
$('.successful').on('keydown', function() {
if($(this).text().length == 0) {
$(this).hide();
}
}
});
#5
1
Using Jquery
使用Jquery
$(".successful").css("display","none");
Though it would be better if you used "#id" for the div instead of ".class"
虽然如果你使用“#id”作为div而不是“.class”会更好
#6
1
You can achieve this in many ways. I just mentioned two in the following link: jsfiddle - full code!
您可以通过多种方式实现这一目标。我刚刚在以下链接中提到了两个:jsfiddle - 完整代码!
<div class="successful">TEST</div>
#1
#2
2
Use
使用
style='display:none;'
after deleting.
删除后。
#3
2
use jquery on deletion activity and hide or display none that dive.
在删除活动上使用jquery并隐藏或显示没有潜水。
style='display:none;'
or use like
或使用像
$('any activity at which you want to delete the div').click(function() {
$('.successful').css('display','none');
});
});
#4
1
You either need to use javascript
or jQuery
to solve this.
你需要使用javascript或jQuery来解决这个问题。
Here is an example using jQuery.
这是一个使用jQuery的例子。
$('.successful').on('keydown', function() {
if($(this).text().length == 0) {
$(this).hide();
}
}
});
#5
1
Using Jquery
使用Jquery
$(".successful").css("display","none");
Though it would be better if you used "#id" for the div instead of ".class"
虽然如果你使用“#id”作为div而不是“.class”会更好
#6
1
You can achieve this in many ways. I just mentioned two in the following link: jsfiddle - full code!
您可以通过多种方式实现这一目标。我刚刚在以下链接中提到了两个:jsfiddle - 完整代码!
<div class="successful">TEST</div>