Reputation: 8727
This is hard to explain so I've put together this JSFiddle. I want the black div to cut through the blue box so that the black div is underneath the horizontal blue lines. So I'd like the <div class="title">Testing</div>
to overlay the <div class="middleFifth">
TIA in advance and sorry for the bad explanation!
Upvotes: 0
Views: 52
Reputation: 439
Try:
.title{
margin-top: -50px;
}
Or other options would be:
.title {
position: relative;
top: -50px;
}
or:
.title {
position: absolute;
top: 50px;
}
Depending on the rest of your page
Upvotes: 0
Reputation: 2818
You can relatively position the black div and set the z-index so that it is behind the blue div (also must specify z-index on blue div).
.title{
width:100%; float:left;
background-color:black;
position: relative;
top: -50px;
z-index: 0;
}
Upvotes: 1
Reputation: 34011
Not entirely sure what you're aiming for, but you could try something like:
.title{
width:100%;
float:left;
background-color:black;
/* Below properties are what I added */
position: absolute;
top: 40px;
z-index: -10;
}
Obviously you should change the z-index to a more sensible value by setting it on your other elements, but I included it here for simplicity's sake.
Upvotes: 0