I do not want to have a space between #id
and .card button
.
i want to put some texts
on top of the buy
without that white space.how can i do that?
css and html:
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
max-width: 400px;
margin: auto;
text-align: center;
font-family: arial;
}
.price {
color: grey;
font-size: 22px;
}
.card button {
border: none;
outline: 0;
padding: 12px;
color: white;
background-color: #000;
text-align: center;
cursor: pointer;
width: 100%;
font-size: 18px;
}
.card button:hover {
opacity: 0.7;
}
.card img {
width: 100%;
height: auto;
}
#id{
background-color: black;
color: white;
}
<!DOCTYPE html>
<html>
<body>
<div class='card'>
<h1>product</h1>
<p class="price">$price</p>
<p id="id">some texts.</p>
<p><button>buy</button></p>
</div>
</body>
</html>
` for elements that aren't a paragraph.
– Ouroborus Apr 19 '22 at 08:39