I need some help here. I am trying to create a page header with some trickiness to it. I need to have a container-fluid with the left half background blue and the right half white. I then need a h2 “Title” /h2 inside a ? container to center it in the 12 columns the title has a border-bottom which stretches the width of the browser though. Here is my code but again I know it is some what half done since I cant figure out the best way to get the 50% background color. I need this to work on IE8 to present and the rest of the major updated browsers.
I hope I can get an image in here for you guys. If not I will set up a bootply for my example.
Thanks ahead of time for your help.
<style>
.halfWrapper{
background: linear-gradient(to right, blue 0%, blue 50%, #fff 50%, #fff 100%);
display:block;
padding:0;
}
.halfAndhalf {
width:50%;
background:blue;
display:inline-block;
}
.halfWrapper h2{color:#fff; text-transform:capitalize; border-bottom:1px solid green;}
</style>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 halfWrapper">
<div class="container halfContain">
<h2>Case Studies</h2>
</div>
</div>
</div>
</div>
2
Answers
Ok so I tried this several ways and feel this may be the best solution. Here is what I came up with. I hope it can solve other peoples issues that are similar.
You are on the right track, just change the class to
body
element.For the fancy underling of the
h2
element I have combinedborder-bottom
property and styledhr
(horizontal rules) element.h2
here is aninline-block
element, therefore theborder-bottom
element is present only for the length of theh2
text. Margins for heading and horizontal rule have been modified to zero pixels.