endamaco
endamaco

Reputation: 163

Put some content before or after a bootstrap container

I need to have a bootstrap container of one color (let's say red) and then I need to color the space on the right with a different color and the space on the left with another one (actually my situation is more difficult because I have an image behind the container and on the right side of the container I should have a transparent effect, while on the left side I should have a solid color).

Do you have any idea on how to achieve it? I did a simple plunker to show what I'm trying to achieve (I tried with :after and :before but with no success)

http://plnkr.co/edit/rvD9ndy2OfY7kCxn0scP?p=preview

.myDiv{
    background-color : red;
}
.myOuterDiv:after{
    background-color : green;
    content : "  ";
}
.myOuterDiv:before{
    background-color : yellow;
    content : "  ";
}

Upvotes: 0

Views: 50

Answers (1)

CChoma
CChoma

Reputation: 1154

While unclear what you're going for, maybe you can consider using a background gradient with the two center stops right on each other.

Like so . . .

http://plnkr.co/edit/OMAfdVi3mK50M1nXNaR7?p=preview

/* Permalink - use to edit and share this gradient: http://colorzilla.com/gradient-editor/#fff000+1,fff000+50,00ff00+51,00ff00+100 */
background: #fff000; /* Old browsers */
background: -moz-linear-gradient(left,  #fff000 1%, #fff000 50%, #00ff00 51%, #00ff00 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(1%,#fff000), color-stop(50%,#fff000), color-stop(51%,#00ff00), color-stop(100%,#00ff00)); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left,  #fff000 1%,#fff000 50%,#00ff00 51%,#00ff00 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left,  #fff000 1%,#fff000 50%,#00ff00 51%,#00ff00 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left,  #fff000 1%,#fff000 50%,#00ff00 51%,#00ff00 100%); /* IE10+ */
background: linear-gradient(to right,  #fff000 1%,#fff000 50%,#00ff00 51%,#00ff00 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fff000', endColorstr='#00ff00',GradientType=1 ); /* IE6-9 */

Upvotes: 1

Related Questions