私は(ウィンドウを閉じるために使用される)、「X」として表示されますdiv要素があります。私の疑似クラスオーバーライドはなぜですか?
<div class="alertwrapper" style="display:inline-block;">
<div class="obj"></div>
<div class="x"></div> //<-----ELEMENT IN QUESTION
</div>
次は、この要素のCSSプロパティです:
.x {
display: none !important;
position: absolute !important;
left:0;
top:0;
transition: transform .25s ease-in-out;
z-index:999;
}
.x:before {
content: "";
position: absolute;
//Here, I've also tried display:none !important;
left: 48%;
margin-left:-495px;
right: 0;
top: 115px;
bottom: 0;
width: 32px;
height: 0;
border-top: 3px solid black;
transform: rotate(45deg);
transform-origin: center;
z-index:999;
}
.x:after {
content: "";
position: absolute;
//Here, I've also tried display:none !important;
left: 48%;
margin-left:-495px;
right: 0;
top: 115px;
bottom: 0;
width: 32px;
height: 0;
border-top: 3px solid black;
transform: rotate(-45deg);
transform-origin: center;
z-index:999;
}
このdiv要素はすべきではありません別の要素は、その時点で、それが表示され、クリックされるまで、次のコードによって定義されるように、表示される:
<script type="text/javascript">
$(document).ready(function() {
$('body').on('click', '.ActiveQuestionCycler', function() {
$("div.x").fadeIn(300).delay(1500);
$("div.obj").fadeIn(300).delay(1500);
});
});
</script>
ページの負荷が、しかし、DIV「X」表示され、 .ActiveQuestionCycler
をクリックする前に(ディスプレイはnoneに設定されていません)。これは疑似クラスbefore
とafter
をオーバーライドする必要があると思いますが、その理由を理解できません。
(.ActiveQuestionCycler
をクリックしたときにdiv.obj
がフェードインん。)
ソースには、エラーアラートはありません。
のように行く:だから、それは次のようになります
.x
にその
display: none;
をドロップすることを忘れないでくださいSnoops、codeplyプロジェクト、codepen、jsfiddleのような、あなたのコードのどこかの実例がありますか? – cwanjt私はもっと簡単なJSFiddleをやります – Snoops
なぜあなたは非常に多くのスタイルタグを持っていますか?私はそれらをすべて1つのスタイルシートに統合します –