I am using the following html and css to design a div with a title and a button at bottom:
.main-container {
height : 100%;
width : 100%;
position : absolute;
background-size : 100% 100%;
display : flex;
align-items : center;
background-color: lightgreen;
}
.content{
margin:auto;
border: 1px solid #0d0d63;
padding: 10px;
}
.title{
top: -21px;
position: relative;
border-bottom: 1px solid green;
}
.bottom-link{
position:relative;
top:19px;
background-color:green;
}
<div class="main-container">
<div class="content">
<div class="title">My Title</div>
test content
<div class="bottom-link">Bottom Link</div>
</div>
</div>
As you can see the title is crossed out because of the border. I can fix it by setting the background color to title
class like I did for bottom-link
. But the issue is I want the background-color
( or image if I add one) of the main-container to be visible throught the title. ie; I need the title div to be transparent. Is there any way to achieve this with css?