I need the css code to create the following box:
This is my approach:
.content-box-gray {
margin: 0 0 0px;
overflow: hidden;
padding: 10px;
height: 15px;
font-size: 15px;
border-radius: 5px;
border: 1px solid gray;
color: #3385FF;
}
Now i need to code the header..
Regards,
MARKUP:
<figure></figure>
STYLE:
figure{
width:400px;
height:220px;
border-radius:4px;
border:2px solid #ccc;
position:relative;
}
figure:before{
content:'';
position:absolute;
top:40px;
left:0;
width:100%;
height:2px;
background:#ccc;
}
RESULT:
UPDATE @petermeissner
if you want to add a tittle and a body, you can use content: attr(data-title)
;
figure{
width:400px;
height:220px;
border-radius:4px;
border:2px solid #ccc;
position:relative;
padding:48px 10px 10px
}
figure:before {
content: attr(data-title);
position: absolute;
top: 0px;
left: 0;
width: 100%;
height: 40px;
line-height: 40px;
text-indent: 10px;
border-bottom: 2px solid #ccc;
}
<figure data-title="Butter Cookies!">
<figcaption>
Homemade vanilla Danish butter cookies are the perfect cookie to share! <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/figure">find out more about this Figure</a>
</figcaption>
</figure>
RESULT:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With