Lynob Lynob - 3 months ago 8
CSS Question

CSS: working with box borders

I'm trying to replicate the white box on this page, Where it says "your success".



body{
background-color:#DFDFDF;
}
.index_whitebox{
background-color: #fff;
height: 60%;
width: 25%;
position: absolute;
margin-left: 4%;
margin-bottom: 20px;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
border-radius: 10px;
}

<div class="index_whitebox">
</div>





I assume there's no
border-style
and I use % for mobile compatibility. I can't seem to get the border right.

Answer

If you look in 'inspect element' you can actually see how they've coded it. I bunched together the main bits they use, as some used a CSS file and others were inline.

.class1 {
    left: 1px;
    width: 302px;
    position: absolute;
    top: 445px;
    height: 378px;
}

.class2 {
    left: 1px;
    width: 302px;
    position: absolute;
    top: 445px;
    height: 378px;
}

.class3{
    border: 2px solid rgba(255, 255, 255, 1);
    background-color: rgba(255, 255, 255, 1);
    border-radius: 5px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

It's all in here:

enter image description here