Pagination with extra space - css

I have some pagination in a div and am seeing some extra space. I'm not sure where it is coming from. The extra space is green (I added a background to the container).
The URL is: http://joshrodg.com/test/inductees/page/2/
Basically, at the bottom of the page, you'll see the pagination. The code is generated, so I can't change that. I'm pretty sure it's something with the css adding the extra space.
I can put a height on the wrap and the extra space goes away, but that's cheating.
The HTML looks like:
<div id="pagi">
<div class="wrap">
<a class="prev page-numbers" href="http://joshrodg.com/test/inductees/"><span class="left"></span><span class="ion-android-arrow-dropleft"></span> Prev</a>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/">1</a>
<span aria-current="page" class="page-numbers current">2</span>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/3/">3</a>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/4/">4</a>
<span class="page-numbers dots">…</span>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/15/">15</a>
<a class="next page-numbers" href="http://joshrodg.com/test/inductees/page/3/">Next <span class="ion-android-arrow-dropright"></span><span class="right"></span></a>
</div>
</div>
The CSS looks like:
#pagi {
text-align: center;
}
#pagi .wrap {
background: #00ff00;
display: inline-block;
font-size: 0;
overflow: hidden;
position: relative;
}
#pagi .page-numbers {
background: #CD1F31;
display: inline-block;
color: #fff;
font-family: 'Lato', sans-serif;
font-size: 18px;
line-height: 40px;
padding: 0 10px;
position: relative;
text-decoration: none;
top: -2px;
}
#pagi .current {
background: #fff;
color: #CD1F31;
}
#pagi .next,
#pagi .prev {
background: #054872;
color: #fff;
font-family: 'Oswald', sans-serif;
font-size: 20px;
line-height: 40px;
position: relative;
text-transform: uppercase;
top: 0;
}
#pagi .next {
padding: 0 35px 0 16px;
}
#pagi .prev {
padding: 0 16px 0 35px;
}
#pagi .left,
#pagi .right {
background: #333;
border-bottom: 21px solid transparent;
border-top: 21px solid transparent;
height: 0;
position: absolute;
top: 0;
width: 0;
}
#pagi .left {
border-right: 12px solid #054872;
left: 0;
}
#pagi .right {
border-left: 12px solid #054872;
right: 0;
}
#pagi .ion-android-arrow-dropleft,
#pagi .ion-android-arrow-dropright {
display: inline-block;
font-size: 30px;
position: absolute;
top: 6px;
}
pagi .ion-android-arrow-dropleft {
left: 18px;
}
#pagi .ion-android-arrow-dropright {
right: 18px;
}
#pagi a:hover .ion-android-arrow-dropleft,
#pagi a:hover .ion-android-arrow-dropright {
color: #fff;
}
#pagi a:hover {
color: #ddd;
}
I know this is probably something simple that I'm over-looking. If someone could point me in the right direction I'd appreciate it!
The one thing I forgot to mention is everything works just fine when the fonts are the same - my guess is the size differences are causing some of the issues.
Thanks,
Josh

So, after investigating this issue further, my problem was being creating by the different Google Web Fonts I was using.
The page numbers use a font called Lato and the Previous and Next links use a font called Oswald.
Somehow the line heights and padding that both fonts had were conflicting and I couldn't get them to play nicely with each other.
Both the Previous and Next links and the page numbers have the same pagenumbers class assigned. Because this is generated code, that's something I can't change.
So, I removed the Oswald font, which fixed the issue...unfortunately, I wanted the font to be different, so I was thinking about other options available visually.
I also had some arrows next to the Previous and Next links. Those arrows were absolutely positioned, so none of the line height issues apply.
After thinking it over I decided to go with arrows-only!
Now, the alignment is fixed and I understand what happened.
The HTML remains unchanged:
<div id="pagi">
<div class="wrap">
<a class="prev page-numbers" href="http://joshrodg.com/test/inductees/"><span class="left"></span><span class="ion-android-arrow-dropleft"></span> Prev</a>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/">1</a>
<span aria-current="page" class="page-numbers current">2</span>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/3/">3</a>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/4/">4</a>
<span class="page-numbers dots">…</span>
<a class="page-numbers" href="http://joshrodg.com/test/inductees/page/15/">15</a>
<a class="next page-numbers" href="http://joshrodg.com/test/inductees/page/3/">Next <span class="ion-android-arrow-dropright"></span><span class="right"></span></a>
</div>
</div>
The CSS looks like:
#pagi {
margin: 5px 20px 25px;
text-align: center;
}
#pagi .wrap {
background: #054872;
display: inline-block;
font-size: 0;
overflow: hidden;
position: relative;
}
#pagi .page-numbers {
background: #CD1F31;
display: inline-block;
color: #fff;
font-family: 'Lato', sans-serif;
font-size: 18px;
line-height: 40px;
padding: 0 10px;
text-decoration: none;
}
#pagi .current {
background: #fff;
color: #CD1F31;
}
#pagi .next,
#pagi .prev {
color: #fff;
text-transform: uppercase;
}
#pagi .next {
padding: 0 25px 0 16px;
}
#pagi .prev {
padding: 0 16px 0 25px;
}
#pagi .left,
#pagi .right {
background: #333;
border-bottom: 21px solid transparent;
border-top: 21px solid transparent;
height: 0;
position: absolute;
top: 0;
width: 0;
}
#pagi .left {
border-right: 12px solid #054872;
left: 0;
}
#pagi .right {
border-left: 12px solid #054872;
right: 0;
}
#pagi .ion-android-arrow-dropleft,
#pagi .ion-android-arrow-dropright {
display: inline-block;
font-size: 30px;
position: absolute;
top: 6px;
}
#pagi .ion-android-arrow-dropleft {
left: 18px;
}
#pagi .ion-android-arrow-dropright {
right: 18px;
}
#pagi a:hover .ion-android-arrow-dropleft,
#pagi a:hover .ion-android-arrow-dropright {
color: #fff;
}
#pagi a:hover {
color: #ddd;
}
There are other ways I could've fixed this. I could've specified a width and absolutely positioned my Previous and Next links, which would also fix this issue because of the absolute positioning.
But, I like this solution and think it is better to just not have the inferred Previous and Next links and just show the icons (pointing in their respective directions).
Thanks,
Josh

Related

When i increase size of box element the box below it goes down like 300px

/* Add a black background color to the top navigation */
body {
margin: 0px;
background-color: rgb(89, 90, 74);
}
.menu {
background-color: rgb(54,54,53);
overflow: hidden;
width: 100%;
padding-bottom: 10px;
padding-top: 10px;
position: fixed;
z-index: 4;
}
.menu a {
font-size: 30px;
font-family: Arial, sans-serif;
color: rgb(176, 254, 118);
text-decoration: none;
margin-left: 15px;
}
.container {
width: 90%;
margin-left: 8%;
margin-right: 8%;
overflow: hidden;
margin-top: 70px;
padding: 30px 0px;
position: absolute;
}
.container div {
display: block;
position: relative;
margin-left: 15px;
margin-bottom: 15px;
width: 250px;
height: 450px;
overflow: hidden;
background-color: rgb(255,255,255);
color: rgb(255,255,255);
float: left;
background-color: rgb(176, 254, 118);
border-radius: 15px;
}
.ahover:hover{
color: rgb(255,255,255);
transition: 0.6s;
}
.ahover:not(:hover){
color: rgb(176, 254, 118);
transition: 0.6s;
}
#sellbox {
color: rgb(54,54,53)
}
#sellbox ul {
list-style: none
}
#sellbox #element {
font-size: 25px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
margin-top: 0px;
margin-bottom: 3px;
}
#sellbox #title {
text-align: center;
font-size: 30px;
margin-top: 4px;
font-family: Arial, Helvetica, sans-serif;
}
#sellbox:hover{
padding: 3px;
box-shadow: rgb(54,54,53) 3px;
}
#sellbox:not(:hover){
padding: 0px;
box-shadow: none;
}
My problem is that the box that says "Buy me" when you hover it, it increases the size, but every other box moves, i tried to check already existing questions on this type but i havent found my answer, could you create a new fiddle with the working one and tell me what was the problem, thanks.
That's the css, also heres a fiddle https://jsfiddle.net/t4r3L2v8/
Change
#sellbox:hover{
padding: 3px;
box-shadow: rgb(54,54,53) 3px;
}
#sellbox:not(:hover){
padding: 0px;
box-shadow: none;
}
to
#sellbox{
padding: 0;
}
#sellbox:hover{
box-shadow: 3px 3px 3px rgb(54,54,53);
}
There's no need for :not(:hover) and as the other answer already said, the padding: 3px makes the element sightly so bigger that it takes up space in the next row.
Also there was something wrong with your box-shadow syntax. Read up on box-shadow on CSS Tricks - Box Shadow
An element floated where it get space first & want to get most top &left space. when you increase padding it little bit take extra space from which break the next flow.
Replace your whole css by this-
/* Add a black background color to the top navigation */
body {
margin: 0px;
background-color: rgb(89, 90, 74);
}
.menu {
background-color: rgb(54,54,53);
overflow: hidden;
width: 100%;
padding-bottom: 10px;
padding-top: 10px;
position: fixed;
z-index: 4;
}
.menu a {
font-size: 30px;
font-family: Arial, sans-serif;
color: rgb(176, 254, 118);
text-decoration: none;
margin-left: 15px;
}
.container {
width: 90%;
margin-left: 8%;
margin-right: 8%;
overflow: hidden;
margin-top: 70px;
padding: 30px 0px;
position: absolute;
}
.container div {
display: block;
position: relative;
margin-left: 15px;
margin-bottom: 15px;
width: 250px;
height: 450px;
overflow: hidden;
background-color: rgb(255,255,255);
color: rgb(255,255,255);
float: left;
background-color: rgb(176, 254, 118);
border-radius: 15px;
}
.ahover:hover{
color: rgb(255,255,255);
transition: 0.6s;
}
.ahover:not(:hover){
color: rgb(176, 254, 118);
transition: 0.6s;
}
#sellbox {
color: rgb(54,54,53);
transition: .5s;
}
#sellbox ul {
list-style: none
}
#sellbox #element {
font-size: 25px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
margin-top: 0px;
margin-bottom: 3px;
}
#sellbox #title {
text-align: center;
font-size: 30px;
margin-top: 4px;
font-family: Arial, Helvetica, sans-serif;
}
#sellbox:hover{
transform: scale(1.03);
box-shadow: 0 0 5px rgb(54,54,53);
}
#sellbox:not(:hover){
padding: 0px;
box-shadow: none;
}
The main reason for this is that you're using padding to highlight your element, the total size of your box is calculated by summing content width, content height, padding and borders (content width + padding-left + padding-right + border-left + border-right) (content height + padding-top + padding-bottom + border-top + border-bottom) so when you increase the padding of a box, its size will increase, and as a result it may push neighbour boxes.
Check box-model to understand more
Solution:
One way to solve it is by defining your box-sizing to border-box, this will prevent the total size of the box from increasing by decreasing the size of the content relatively to the border and padding.
it would be good if you add this property to every element in your page by adding the following css code:
*{
box-sizing: border-box;
}
Your problem's solution:
One way to highlight your element is by using transform: scale(value), scale() will resize your element as shown in documentation (increase if value > 1, decrease if value < 1)
your code should look like this, feel free to change the value in order to understand how it works:
#sellbox:hover{
transform: scale(1.03);
box-shadow: rgb(54,54,53) 3px;
}
/* Add a black background color to the top navigation */
*{
box-sizing: border-box;
}
body {
margin: 0px;
background-color: rgb(89, 90, 74);
}
.menu {
background-color: rgb(54,54,53);
overflow: hidden;
width: 100%;
padding-bottom: 10px;
padding-top: 10px;
position: fixed;
z-index: 4;
}
.menu a {
font-size: 30px;
font-family: Arial, sans-serif;
color: rgb(176, 254, 118);
text-decoration: none;
margin-left: 15px;
}
.container {
width: 90%;
margin-left: 8%;
margin-right: 8%;
overflow: hidden;
margin-top: 70px;
padding: 30px 0px;
position: absolute;
}
.container div {
display: block;
position: relative;
margin-left: 15px;
margin-bottom: 15px;
width: 250px;
height: 450px;
overflow: hidden;
background-color: rgb(255,255,255);
color: rgb(255,255,255);
float: left;
background-color: rgb(176, 254, 118);
border-radius: 15px;
}
.ahover:hover{
color: rgb(255,255,255);
transition: 0.6s;
}
.ahover:not(:hover){
color: rgb(176, 254, 118);
transition: 0.6s;
}
#sellbox {
color: rgb(54,54,53)
}
#sellbox ul {
list-style: none
}
#sellbox #element {
font-size: 25px;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
margin-top: 0px;
margin-bottom: 3px;
}
#sellbox #title {
text-align: center;
font-size: 30px;
margin-top: 4px;
font-family: Arial, Helvetica, sans-serif;
}
#sellbox:hover{
transform: scale(1.03);
box-shadow: rgb(54,54,53) 3px;
}
#sellbox:not(:hover){
padding: 0px;
box-shadow: none;
}
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="menu">
<a class="ahover" href="#home">
Home
</a>
<a class="ahover" href="#contact">
Contact us
</a>
<a class="ahover" style="margin-left: 78%;" href="#signup">Sign up</a>
</div>
<div class="container">
<div id="sellbox">
<p id="title">Buy me now</p>
<p id="element">whew</p>
<p id="element">whew</p>
<p id="element">whew</p>
<p id="element">whew</p>
<p id="element">whew</p>
<p id="element">whew</p>
<p id="element">whew</p>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
<div>
</div>
</div>
</body>
</html>
the boxes are moving because you are padding when you hover over it and it cause the element size to enlarge and to make space for that size it pushes items

How to transform/transition div without moving the text?

I created an overlay menu for the responsive menu of website. every thing is OK but when the menu will be closed, the texts (in menu) will be gathered and moved individually and then disappear but I want them to slide out without moving texts.
I tried these HTML:
<section class="overlaysection">
<div id="myoverlaynav" class="overlay">
×
<div class="overlay-content">
<li><a>num one one one one</a></li>
<li><a>num two two two two</a></li>
<li><a>num three three three three</a></li>
<li><a>num four four four four four</a></li>
</div>
</div>
<div class="overlaybtndiv" onclick="openNav()">
<button class="overlaybtn">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h2>The Menu</h2>
</div>
</section>
CSS Codes:
#media (min-width: 631px){
.overlaysection {
display: none;
}
}
.overlaysection .overlay {
height: 100%;
width: 0;
position: fixed;
/* z-index: 1; */
z-index: 999999;
top: 0;
left: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 0.5s;
direction:rtl;
}
.overlaysection a.closebtn {
position: absolute;
font-size: 40px;
padding: 0;
line-height: 40px;
top: 10px;
right: 10px;
color: #eee;
}
.overlaysection .overlay-content {
position: relative;
width: 100%;
text-align: center;
margin-top: 40px;
}
.overlaysection .overlay a {
display: block;
transition: 0.3s;
text-align: left;
color: #eee;
padding: 8px 8px 8px 20px;
text-decoration: none;
}
.overlaysection .overlay a:hover,
.overlaysection .overlay a:focus {
color: #f1f1f1;
}
.overlaysection .overlaybtndiv {
display: block;
padding: 6px 8px;
position: relative;
}
.overlaysection .overlaybtndiv h2 {
font-size: 14px;
color: black;
line-height: 40px;
margin-right: 10px;
}
.overlaysection .overlaybtn {
border-color: transparent !important;
float: right;
padding: 5px;
background: white;
outline: 0;
}
.overlaysection .overlaybtn .icon-bar {
display: block;
height: 2px;
border-radius: 1px;
padding: 1.5px;
width: 28px;
background-color: black !important;
margin-top: 5px;
}
.overlaysection .overlaybtn .icon-bar:first-child {
margin-top: 3px !important;
}
.
javascript codes:
function openNav() {
document.getElementById("myoverlaynav").style.width = "80%";
}
function closeNav() {
document.getElementById("myoverlaynav").style.width = "0%";
}
you can see this menu in https://end-eng.com/grammar/auxiliary-modal-verbs-in-english/ and this menu is like https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_sidenav
Add min-width and float:left to .overlay-content.
.overlaysection .overlay-content {
position: relative;
width: 100%;
text-align: center;
margin-top: 50px;
min-width: 270px;
float: left;
}
right now what happening is when close navbar its width is reduced so thus your li tag width to so, just give your li tag fixed width and your problem will be solved like.
#media (min-width: 631px){
.li {
width : 200px;
}
}
and only give this in media query for smaller devices otherwise it will replicate in whole website.
It's because you're using width's to control the display.
Instead of this, I suggest that you toggle a "shown" class to your overlay.
By default on your ".overlaysection .overlay" css, change the width to 100% and left to -100%;
Then on the "shown" class set the left to 0. Change the JS to toggle the
shown class and it should then slide out from the left without changing the text orientation.
function openNav() {
document.getElementById("myoverlaynav").classList.toggle('shown');
}
function closeNav() {
document.getElementById("myoverlaynav").classList.toggle('shown');
}
#media (min-width: 631px){
.overlaysection {
display: none;
}
}
.overlaysection .overlay {
height: 100%;
width: 100%;
position: fixed;
/* z-index: 1; */
left: -100%;
z-index: 999999;
top: 0;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0, 0.9);
overflow-x: hidden;
transition: 0.5s;
direction:rtl;
}
.overlaysection a.closebtn {
position: absolute;
font-size: 40px;
padding: 0;
line-height: 40px;
top: 10px;
right: 10px;
color: #eee;
}
.overlaysection .overlay-content {
position: relative;
width: 100%;
text-align: center;
margin-top: 40px;
}
.overlaysection .overlay a {
display: block;
transition: 0.3s;
text-align: left;
color: #eee;
padding: 8px 8px 8px 20px;
text-decoration: none;
}
.overlaysection .overlay a:hover,
.overlaysection .overlay a:focus {
color: #f1f1f1;
}
.overlaysection .overlaybtndiv {
display: block;
padding: 6px 8px;
position: relative;
}
.overlaysection .overlaybtndiv h2 {
font-size: 14px;
color: black;
line-height: 40px;
margin-right: 10px;
}
.overlaysection .overlaybtn {
border-color: transparent !important;
float: right;
padding: 5px;
background: white;
outline: 0;
}
.overlaysection .overlaybtn .icon-bar {
display: block;
height: 2px;
border-radius: 1px;
padding: 1.5px;
width: 28px;
background-color: black !important;
margin-top: 5px;
}
.overlaysection .overlaybtn .icon-bar:first-child {
margin-top: 3px !important;
}
#myoverlaynav.shown {
left: 0;
}
<section class="overlaysection">
<div id="myoverlaynav" class="overlay">
×
<div class="overlay-content">
<li><a>num one one one one</a></li>
<li><a>num two two two two</a></li>
<li><a>num three three three three</a></li>
<li><a>num four four four four four</a></li>
</div>
</div>
<div class="overlaybtndiv" onclick="openNav()">
<button class="overlaybtn">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<h2>The Menu</h2>
</div>
</section>

css vertical form steps indicator?

I'm trying to create a vertical form steps indicator using css.
I found this https://codepen.io/erwinquita/pen/ZWzVRE which works fine in the codepen but when I try to copy the code from there and use it in my html page, the green circles do not show up!
I even copied the code and pasted it in jsfiddle but the same issue accrued.
this is the code:
.wrapper {
width: 330px;
font-family: 'Helvetica';
font-size: 14px;
border: 1px solid #CCC;
}
.StepProgress {
position: relative;
padding-left: 45px;
list-style: none;
&::before {
display: inline-block;
content: '';
position: absolute;
top: 0;
left: 15px;
width: 10px;
height: 100%;
border-left: 2px solid #CCC;
}
&-item {
position: relative;
counter-increment: list;
&:not(:last-child) {
padding-bottom: 20px;
}
&::before {
display: inline-block;
content: '';
position: absolute;
left: -30px;
height: 100%;
width: 10px;
}
&::after {
content: '';
display: inline-block;
position: absolute;
top: 0;
left: -37px;
width: 12px;
height: 12px;
border: 2px solid #CCC;
border-radius: 50%;
background-color: #FFF;
}
&.is-done {
&::before {
border-left: 2px solid green;
}
&::after {
content: "✔";
font-size: 10px;
color: #FFF;
text-align: center;
border: 2px solid green;
background-color: green;
}
}
&.current {
&::before {
border-left: 2px solid green;
}
&::after {
content: counter(list);
padding-top: 1px;
width: 19px;
height: 18px;
top: -4px;
left: -40px;
font-size: 14px;
text-align: center;
color: green;
border: 2px solid green;
background-color: white;
}
}
}
strong {
display: block;
}
}
<div class="wrapper">
<ul class="StepProgress">
<li class="StepProgress-item is-done"><strong>Post a contest</strong></li>
<li class="StepProgress-item is-done"><strong>Award an entry</strong>
Got more entries that you love? Buy more entries anytime! Just hover on your favorite entry and click the Buy button
</li>
<li class="StepProgress-item current"><strong>Post a contest</strong></li>
<li class="StepProgress-item"><strong>Handover</strong></li>
<li class="StepProgress-item"><strong>Provide feedback</strong></li>
</ul>
</div>
I don't understand what I am missing.
could someone please advice on this issue?
In the codepen link you've provided, LESS CSS Preprocessor has been used. That's why you couldn't replicate the same code with jsfiddle or your local instance. Simply, the CSS isn't working in your case, you are viewing the plain html because when you use the css preprocessor, browser can't render it directly.
If you want this code to work in jsfiddle, then you have to select SCSS as the language in the dropdown menu named as css in the css box. Here's the link that shows it is working: https://jsfiddle.net/9k67r0eg/1/
And if you want to use it in your local browser, then you may want to compile it. Check it here: http://lesscss.org/
However, the LESS can be converted to pure css also. Here's the converted code which you can use directly:
.wrapper {
width: 330px;
font-family: 'Helvetica';
font-size: 14px;
border: 1px solid #CCC;
}
.StepProgress {
position: relative;
padding-left: 45px;
list-style: none;
}
.StepProgress::before {
display: inline-block;
content: '';
position: absolute;
top: 0;
left: 15px;
width: 10px;
height: 100%;
border-left: 2px solid #CCC;
}
.StepProgress-item {
position: relative;
counter-increment: list;
}
.StepProgress-item:not(:last-child) {
padding-bottom: 20px;
}
.StepProgress-item::before {
display: inline-block;
content: '';
position: absolute;
left: -30px;
height: 100%;
width: 10px;
}
.StepProgress-item::after {
content: '';
display: inline-block;
position: absolute;
top: 0;
left: -37px;
width: 12px;
height: 12px;
border: 2px solid #CCC;
border-radius: 50%;
background-color: #FFF;
}
.StepProgress-item.is-done::before {
border-left: 2px solid green;
}
.StepProgress-item.is-done::after {
content: "✔";
font-size: 10px;
color: #FFF;
text-align: center;
border: 2px solid green;
background-color: green;
}
.StepProgress-item.current::before {
border-left: 2px solid green;
}
.StepProgress-item.current::after {
content: counter(list);
padding-top: 1px;
width: 19px;
height: 18px;
top: -4px;
left: -40px;
font-size: 14px;
text-align: center;
color: green;
border: 2px solid green;
background-color: white;
}
.StepProgress strong {
display: block;
}
<div class="wrapper">
<ul class="StepProgress">
<li class="StepProgress-item is-done"><strong>Post a contest</strong></li>
<li class="StepProgress-item is-done"><strong>Award an entry</strong> Got more entries that you love? Buy more entries anytime! Just hover on your favorite entry and click the Buy button
</li>
<li class="StepProgress-item current"><strong>Post a contest</strong></li>
<li class="StepProgress-item"><strong>Handover</strong></li>
<li class="StepProgress-item"><strong>Provide feedback</strong></li>
</ul>
</div>

How can I make a shape like this using css and div

https://www.cp24.com/polopoly_fs/7.687199!/httpImage/image.jpg_gen/derivatives/default/image.jpg
I want to accomplish something similar to the image attached, I tried several post but didn't get it done, please help me.
Thanks
You can utilise the CSS :after pseudo-element to achieve a similar item, for example:
#banner {
font-family: sans-serif;
text-transform: uppercase;
}
#banner > div {
display: inline-block;
height: 40px;
line-height: 40px;
padding: 0 20px;
}
#banner .banner-grey {
background: #aaa;
position: relative;
}
#banner .banner-grey:after {
border: 20px solid transparent;
border-left-color: #aaa;
content: '';
display: block;
position: absolute;
right: -40px;
top: 0;
}
#banner .banner-red {
background: red;
font-weight: bold;
margin-left: -4px;
padding-left: 60px;
}
#banner .banner-red span {
color: #fff;
font-style: italic;
}
<div id="banner">
<div class="banner-grey">Check out our <b>live and interactive screen</b></div>
<div class="banner-red"><span>CP24</span>now</div>
</div>

Bootstrap HTML5 Title with border and small text like fieldset but no fieldset/legend

I am building bootstrap based web and I am trying to make title inside of a frame with text attached in the middle of bottom border and still be responsive. Small text on small devices can go in multiple rows, or even go inside the box.
All I could do is. And I want to do it like .
I hope someone already done this and/or could help me doing it.
Thanks in advance.
One big detail is it should be completely transparent so it can go over a backround picture.
And it is much differend than fieldset because the "legend" is on bottom.
Update:
See fiddle
CSS:
.navbar-brand {
margin: 0;
color: #ffffff;
text-align: center;
position: relative;
display: inline-block;
border-top: 8px solid #ffffff;
padding: 5px 32px 0px 32px;
line-height: 1.08333333;
height: auto;
}
.navbar-brand:before {
position: absolute;
content: '';
left: -8px;
top: -8px;
width: 8px;
bottom: 12px;
background: #ffffff;
}
.navbar-brand:after {
position: absolute;
content: '';
right: -8px;
top: -8px;
width: 8px;
bottom: 12px;
background: #ffffff;
}
.navbar-brand a:hover,
.navbar-brand a:focus {
color: #ffffff;
text-decoration: none;
}
.navbar-header + h3 {
margin-top: 61px;
}
.navbar-header {
text-align: center;
}
.small-lines:before {
position: absolute;
content: '';
left: -40px;
height: 8px;
bottom: 12px;
width: 8%;
background: #ffffff;
}
.small-lines:after {
position: absolute;
content: '';
right: -40px;
height: 8px;
bottom: 12px;
width: 8%;
background: #ffffff;
}
.small-lines1:before {
width: 38%;
background: #009fb6;
}
.small-lines1:after {
width: 38%;
background: #009fb6;
}
.navbar-brand a{
font-size: 48px;
}
.container{
margin-top: 150px;
}
small {
line-height: 1.2;
font-size: 24px;
letter-spacing: 4.8px;
display: block;
position: relative;
}
HTML:
<body style="background: black">
<header class="">
<div class="container text-center">
<div class="navbar-header">
<h1 class="navbar-brand ">
<a href="./">BIG TITLE ONE<br>
<small class="small-lines">Here comes small text</small>
</a>
</h1>
</div>
</div>
</header>
</body>

Resources