This is the sample HTML generated from my javascript. Just wondering how come setting display:none;
will affect the UI? Below is the code snippet
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style>
.card {
display: inline-block;
text-align: center;
margin: 5px;
padding: 10px;
width: 70px;
height: 100px;
font-size: 26px;
background-color: black;
border: solid 1px black;
color: white;
border-radius: 10px;
}
.holeCard {
/*visibility: hidden;*/
border: solid 1px black;
background: repeating-linear-gradient( 45deg, #606dbc, #606dbc 10px, #465298 10px, #465298 20px );
}
</style>
</head>
<body>
<div class="card red">
<span class="dealerCardFace">2</span>
<span class="dealerCardSuit">♦</span>
</div>
<div class="card red holeCard">
<span class="dealerCardFace">7</span>
<span class="dealerCardSuit">♦</span>
</div>
</body>
</html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
//$('.holeCard').eq(1).hide();
$(".holeCard > :nth-child(1)").hide();
$(".holeCard > :nth-child(2)").hide();
</script>
If I remove the display:none,
it will look like below which is what I want.