I would like to put vertical lines left and right of this Logo text, but both lines need to touch the bottom border, this is what I have now: Here’s a codepen:
http://codepen.io/anon/pen/ZBMXbw
.header-container {
/*padding: 8px;*/
border-bottom: 2px solid lightgrey;
margin-top: 20px;
}
.logo {
font-size: 12px;
font-weight: bold;
position: relative;
bottom: -10px;
}
.col-md-1 {
border-left: 1px solid grey;
}
h4 {
font-weight: bold;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="container">
<div class="row">
<div class="header-container col-md-8 col-md-offset-2">
<div class="col-md-1 logo">Logo here</div>
<div class="col-md-11">
<h4>lorem ipsum lorem lorem</h4>
</div>
</div>
</div>
</div>
4
Answers
Use pseudo-elements on
.logo
. Like this:Demo
UPDATED: Thanks to comment by besciualex
it seems to me that what you need is to use the pseudo selectors ::before and ::after. Try the following:
Let me know if this works.
Updated copen.
You can use
line-height
:You can use CSS Flexbox for this. Make your
.header-container
a flex container. Have a look at the snippet below:Hope this helps!