Tuesday, 20 August 2013

CSS before selector fill available space

CSS before selector fill available space

Is there a way to make a before selector fill the right side of space that
is free and leave the left side untouched?

I want the red line to fill the right side of available space, is it
achievable?
.grey {
border-left:1px solid #d1d1d1;
background: #e0e0e0;
}
.grey:before {
content:'';
width:100%;
height:100%;
background:red;
position:absolute;
z-index:-99;
}
I'm using Bootstrap RC2. The .grey class is added to a col-4 div.
I want the left side of the screen to be untouched, but the right side to
be filled with the "red" color. The color should start from the col-4 div.

No comments:

Post a Comment