I've been trying to put in a paragraph into my div and it keeps pushing down the div. When i put in a normal div it doesn't change and it gets not pushed down. What is the problem here?
I tried to display the p tag as absolute but that is not really professional and it looks ugly. Also i have put a div into the parent div and it worked. It only does that with the p tag.
.mod {
transition-duration: 0.05s;
display: inline-block;
height: 600px;
width: 337px;
padding-left: 7px;
padding-right: 7px;
position: relative;
background-color: red;
}
.modpic {
transition-duration: 0.05s;
height: 130px;
width: 337px;
background-position: center;
background-size: 686px 430px;
background-color: grey;
}
.namediv {
text-align: center;
width: 100%;
background-color: blue;
}
.name {
letter-spacing: 0.3px;
color: white;
font-size: 26px;
font-family: 'Barlow Condensed';
}
<div class="mod">
<div class="modpic">
</div>
<div class="namediv">
<p class="name">Example</p>
</div>
</div>
I expect that the p tag gets displayed under the "modpic" but it just messes everything up.