I am looking to create a similar widget on my page https://kunalaren.com/about-me/
My subscription div is falling out of place. I need to align it in the same way as it is shown in the image.
Width of each div is set to 50% and 1,3 and 2,4 child of .cta are supposed to be float in left and right respectively.
Any help is appreciated.
HTML
<div class="cta">
<div> <p>Double Your Sales Today!</p></div>
<div><p>Use the form below to open his daily email tips and free consultation worth $97.</p></div>
<div><p>Leader of SEO and Digital Marketing is Giving Away Tips For Doubling Sales Right Now!</p></div>
<div>[contact-form-7 id="125" title="Subscribe"]</div>
</div>
CSS
.cta{
background-color:white;
width:100%;
padding:10px;
}
.cta div:nth-child(1){
width:50%;
float:left;
}
.cta div:nth-child(1) > p{
margin:0px;
padding-left:30px;
padding-bottom:10px;
display:inline-block;
font-weight:bolder;
font-size:40px;
color:black;
font-family: 'Roboto Condensed', sans-serif;
}
div.cta div:nth-child(2){
width:50%;
float:right;
}
div.cta div:nth-child(2)>p{
color:black;
text-align:center;
font-family: 'Style Script', cursive;
margin:0px;
font-size:40px;
background-color:#ffc569;
line-height:40px;
padding:5px;
}
div.cta div:nth-child(3)>p{
color:black;
font-size:20px;
font-weight:bold;
}
div.cta div:nth-child(3){
width:50%;
font-family: 'Roboto Condensed',serif;
padding-left:25px;
}
div.cta div:nth-child(4){
float:right;
width:50%;
margin-top:0px;
}
/*******Mob. Responsive***/
@media only screen and (max-width: 900px){
div.cta div:nth-child(n),div.cta div:nth-child(n)>p{
float:none;
width:100%;
text-align:center;
padding-left:0px;
}
}
2
Answers
You can use this
CSS:
I removed some styling, but grid should work ok