HTML creating 2 rows with contents in div - html

Fairly new to HTML and coding..
I'm having trouble with a box that needs to display 8 items within it as 2 rows:
I have 8 divs (class="item_css") within a div(class="example_box"), how do I display the 8 items in 2 rows, so it shows a row of 4 and then another 4.
I want to avoid using the 'rows' class. What would be the best way to do this?
CSS
* {
margin: 0;
padding: 0;
}
.body_background {
background-color: bisque;
}
.example_banner {
background-color: rgb(247, 245, 245);
height: auto;
width: 100%;
margin: 3% auto;
padding: 4% 0%;
box-shadow: 0px 2px 5px #cccccc;
}
.example_banner_label {
text-align: center;
margin: 2px auto 25px;
}
.example_banner_heading {
font-size: 30px;
text-align: center;
margin: 0% auto;
color: rgb(7 29 148);
text-shadow: 1px 1px #c7c7c7;
}
.example_banner_box {
width: 90%;
height: auto;
margin: 0% auto;
padding: 0%;
}
.example_banner_frame {
display: flex;
position: relative;
height: auto;
width: 1200px;
margin: 0% auto;
padding: 0px;
text-align: center;
background-color: #ffffff;
border: 1px solid #b7b7b7;
}
.example_banner_frame_maincontents {
width: 300px;
height: 450px;
}
div.example_consumer_banner {
width: 300px;
height: 60px;
padding: 10px;
font-size: 25px;
margin: 0%;
text-align: center;
color: white;
background-color: #193cad;
}
.example_consumer_img_label {
width: 20%;
position: absolute;
top: 25%;
left: 10%;
transform: translate(-50%, -50%);
font-size: 25px;
font-family: "Montserrat", sans-serif;
text-align: center;
color: rgb(255 255 255);
text-decoration: none;
text-shadow: -3px 4px 3px rgb(0 0 0);
}
.example_box {
width: 75%;
height: 450px;
background-color: #00b6f3;
}
.item_css {
width: 25%;
height: 150px;
margin: 0%;
padding: 3px;
}
HTML
<section class="main_body">
<div class="body_background">
<div class="row" id="merch_rows">
<div class="example_banner">
<div class="example_banner_frame">
<div class="example_banner_frame_maincontents">
<div class="example_consumer_banner" for="">Lorem ipsum</div>
<img src="" class="example_consumer_picture">
<label class="example_consumer_img_label" for="example_consumer_picture">Lorem ipsum dolor sit amet consectetur </label>
</div>
<div class="example_box">
<div class="item_css" style="color: red; border: 1px solid grey;">1
</div>
<div class="item_css" style="color: orange;border: 1px solid grey;">2
</div>
<div class="item_css" style="color: green;border: 1px solid grey;">3
</div>
<div class="item_css" style="color: yellow;border: 1px solid grey;">4
</div>
<div class="item_css" style="color: blue;border: 1px solid grey;">5
</div>
<div class="item_css" style="color: black;border: 1px solid grey;">6
</div>
<div class="item_css" style="color: grey;border: 1px solid grey;">7
</div>
<div class="item_css" style="color: pink;border: 1px solid grey;">8
</div>
</div>
</div>
</div>
</div>
</section>

Just a simple example on flexbox:
.example_box {
display: flex;
justify-content: space-between;
flex-wrap: wrap;
}
.item_css {
width: 24%;
margin-bottom: 10px;
}
or grid:
.example_box {
display: grid;
grid-template-columns: repeat(4, 1fr);
grid-gap: 10px;
}

Flexbox would do this.
https://jsfiddle.net/za678wcL/
<div class="container">
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
<div class="box"></div>
</div>
.container {
display: flex;
flex-wrap: wrap;
}
.box {
background-color: green;
height: 50px;
width: calc(25% - 20px);
margin: 10px;
}

Related

CSS Animation (Appear from the side by clicking)

I'm trying to make something apppear from the right side in a div when I'm click on it.
It's a Div (dish) that have 2 Div in it (infoDish) and (validation).
infoDish have a width of 100%, validation have a width of 20% but is hidden unless I click on Dish.
I can make validation appear and disappear but the thing is it's instantaneus and I want to create an animation that take 1 or 2 seconds to make it appear from the right side (like you open the window from the right to the left).
.plat {
border: 1px solid black;
height: 70px;
width: 95%;
display: flex;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border-radius: 20px;
background-color: white;
margin-bottom: 20px;
margin-left: 3%;
cursor: pointer;
}
.plat:hover .divValid {
border: 1px solid purple;
background-color: #99E2D0;
border-radius: 0 20px 20px 0;
justify-content: center;
align-items: center;
height: 100%;
width: 20%;
}
.partRouge {
border: 1px solid red;
height: 100%;
width: 100%;
}
.divTitlePlat {
border: 1px solid orangered;
height: 50%;
width: 100%;
padding-left: 2%;
}
.divTitlePlat h3 {
font-size: 20px;
margin-top: 0;
}
.divInfoPlat {
border: 1px solid blue;
height: 50%;
width: 100%;
display: flex;
justify-content: space-between;
}
.divDescPlat {
border: 1px solid green;
height: 100%;
width: 80%;
padding-left: 2%;
}
.divPricePlat {
border: 1px solid yellow;
height: 100%;
width: 20%;
}/*# sourceMappingURL=menuresto.css.map */
<div class="plat">
<div class="partRouge">
<div class="divTitlePlat">
<h3>Tartare de poulpe acidulé</h3>
</div>
<div class="divInfoPlat">
<div class="divDescPlat">
<span>Aux zests d'orange</span>
</div>
<div class="divPricePlat">
<span class="price">25€</span>
</div>
</div>
</div>
<div class="divValid">
<!--<i class="fa-solid fa-circle-check"></i>-->
</div>
</div>
I don't know if I understood what you really want to do...
But if you want to add a little delay, not to change instantly you can add the CSS property transition in the class with the hover. You can even precise for each property you want a delay and the delay. To do this, you have to write:
transition: 1s;
To have more informations about this property, you can read:
https://www.w3schools.com/css/css3_transitions.asp
With your code, it's not perfect but if it's what you were searching for, the changement on the hover is now not instantly, but with a delay of 1 second.
.plat {
border: 1px solid black;
height: 70px;
width: 95%;
display: flex;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
border-radius: 20px;
background-color: white;
margin-bottom: 20px;
margin-left: 3%;
cursor: pointer;
}
.plat:hover .divValid {
border: 1px solid purple;
background-color: #99E2D0;
border-radius: 0 20px 20px 0;
justify-content: center;
align-items: center;
height: 100%;
width: 20%;
transition: 1s;
}
.partRouge {
border: 1px solid red;
height: 100%;
width: 100%;
}
.divTitlePlat {
border: 1px solid orangered;
height: 50%;
width: 100%;
padding-left: 2%;
}
.divTitlePlat h3 {
font-size: 20px;
margin-top: 0;
}
.divInfoPlat {
border: 1px solid blue;
height: 50%;
width: 100%;
display: flex;
justify-content: space-between;
}
.divDescPlat {
border: 1px solid green;
height: 100%;
width: 80%;
padding-left: 2%;
}
.divPricePlat {
border: 1px solid yellow;
height: 100%;
width: 20%;
}/*# sourceMappingURL=menuresto.css.map */
<div class="plat">
<div class="partRouge">
<div class="divTitlePlat">
<h3>Tartare de poulpe acidulé</h3>
</div>
<div class="divInfoPlat">
<div class="divDescPlat">
<span>Aux zests d'orange</span>
</div>
<div class="divPricePlat">
<span class="price">25€</span>
</div>
</div>
</div>
<div class="divValid">
<!--<i class="fa-solid fa-circle-check"></i>-->
</div>
</div>

How can I add spacing between these progress bar titles?

THIS IS A RESPONSIVE DESIGN, MAKE SURE TO TURN ON TOGGLE DEVICE TOOLBAR ON YOUR BROWSER
I am trying to make a progress bar. First I want to increase the height of the transparent black background. I can't find a way to do that. I am confused. And secondly, I want to add spacing and align the 2nd and 3rd text properly.
/* progress bar */
.center {
height: 300px;
width: 100%;
position: absolute;
left: 50%;
margin-top: 140px;
transform: translate(-50%, -50%);
padding: 20px;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div>
</section>
</section>
You can take advantage of the <br> element in your HTML.
Line break and tab elements can be used when you need a little more control over how the browser renders the text. The <BR> element is used to force a line break.
-W3.org
/* progress bar */
.center {
height: 300px;
width: 100%;
position: absolute;
left: 50%;
margin-top: 140px;
transform: translate(-50%, -50%);
padding: 20px;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<br>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<br>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<br>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
The Height: - I noticed a fixed height of 300px, and that you were centering the parent div by using margins and translations in your CSS. I went ahead and removed those margins and translations, also removed your absolute positioning. You can adjust your fixed height of 300px to expand the grey background. For this example, I made it 100 view height.
/* progress bar */
.center {
height: 100vh;
width: 100%;
padding: 20px;
position: relative;
background-color: rgba(0, 0, 0, 0.678);
box-shadow: 0 2px 60px rgba(0, 0, 0, .5);
border-radius: 10px;
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 20px 0;
}
/* skillbar languages */
.skillbar-html p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-html p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skillbar-css p{
color: #fff;
text-transform: uppercase;
margin: 0 0 10px;
padding: 0;
font-weight: bold;
letter-spacing: 3px;
}
.skillbar-css p:nth-child(2){
float: right;
position: relative;
top: -30px;
}
.skill_percentage{
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<br>
<div class="skillbar-html">
<p>HTML</p>
<p>90%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;"></div>
</div>
<br>
<div class="skillbar-css">
<p>CSS</p>
<p>70%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;"></div>
</div>
<br>
<div class="skillbar-javascript">
<p>JavaScript</p>
<p>50%</p>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;"></div>
</div>
</div>
</div>
</div>
</div>
</section>
If I understood properly, what you want to increase the height is for that black bar containing your actual progress bar, right? If that's the case, I think this should work:
.skill-percentage {
height: x (here you place how much height you want);
}
That should give you the height that you want.
And, in order to add the spacing, you can take advantage of CSS padding or margin, depending on what you exactly need.
I'll give you a small snippet here so you can see exactly what I mean. Note that I modified a bit your HTML to fit what you wanted to do, but this may not be necessary on your original file.
/* progress bar */
* {
margin: 0;
padding: 0;
}
.center {
height: 500px;
width: 100%;
background-color: rgba(0, 0, 0, 0.678);
color: white;
}
.center #progress{
margin: 0px;
padding: 0;
color: #fff;
text-transform: uppercase;
letter-spacing: 8px;
border-radius: 20px;
height: auto;
background-color: rgba(0, 0, 0, 0);
}
.skillbar{
box-sizing: border-box;
width: 100%;
margin: 0;
}
/* skillbar languages */
.text-container {
display: flex;
width: 100%;
justify-content: space-between;
}
.text-container p {
padding: 0 40px; /* this is the one that changes the position of your text. Be carefull, you don't want this to change the position too much, just a bit, if you need to change the full position, better try something like grid, or modifying the flex */
}
.skillbar-html {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-html p {
margin: 10px;
}
.skillbar-html > div {
margin: 10px;
}
.skillbar-css {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-css p {
margin: 10px;
}
.skillbar-css > div {
margin: 10px;
}
.skillbar-javascript {
display: flex;
flex-direction: column;
justify-content: center;
}
.skillbar-javascript p {
margin: 10px;
}
.skillbar-javascript > div {
margin: 10px;
}
.skill_percentage{
height: 20px; /* this is the one that changes your height, now it's changing nothing, but you can modify the height by changing this value */
background-color: #262626;
padding: 4px;
box-sizing: border-box;
border: 1px solid #0fffb7;
border-radius: 6px;
}
.skill_level{
background-color: #0fffb7;
width: 100%;
height: 10px;
border-radius: 6px;
}
<section>
<div class="center">
<h1 id="progress">Progress</h1>
<div class="skillbar-html">
<div class="text-container">
<p>HTML</p>
<p>90%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 90%;">
</div>
</div>
</div>
<div class="skillbar-css">
<div class="text-container">
<p>CSS</p>
<p>70%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 80%;">
</div>
</div>
</div>
<div class="skillbar-javascript">
<div class="text-container">
<p>JavaScript</p>
<p>50%</p>
</div>
<div class="skill_percentage">
<div class="skill_level" style="width: 50%;">
</div>
</div>
</div>
</div>
</section>

How to neatly place the ranking to the left of a picture in CSS

Currently, my HTML looks like
However, I want to make it look similar to where the picture and ranking don't overlap.
This is my CSS and HTML for the element.
.star-list {
display: flex;
align-items: center;
padding: 5px;
width: 680px;
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0px 10px 20px -6px #1abc9c;
background-color: #fff;
border-radius: 10px;
height: 155px;
margin-top: 20px;
margin-left: 10px;
margin-bottom: 10px;
font-size: 5vw;
}
.star-list>img {
height: 140px;
border-radius: 10px;
}
.star-list>.media-content {
width: 1000px;
display: flex;
justify-content: center;
font-weight: 600;
font: black;
font-size: 5vw;
}
<div class="card_body">
<div>
<div class="card word_shadow2">
<div class="card-header">
RANKING
</div>
<div class="card-body" id="star-box">
<div class="star-list">
1
<img src="https://api.buzzanglemusic.com/images/artists/771" alt="Placeholder image" />
<span class="media-content">
Eagles
</span>
</div>
</div>
</div>
</div>
</div>
I would like the ranking to not overlap with the picture. Thanks.
.star-list {
display: flex;
align-items: center;
padding: 5px;
width: 680px;
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0px 10px 20px -6px #1abc9c;
background-color: #fff;
border-radius: 10px;
height: 155px;
margin-top: 20px;
margin-left: 10px;
margin-bottom: 10px;
font-size: 5vw;
}
.star-list p.rank {
padding: 0 50px;
font-weight: 700;
}
.star-list>img {
height: 140px;
border-radius: 10px;
}
.star-list>.media-content {
width: 1000px;
display: flex;
justify-content: center;
font-weight: 600;
font: black;
font-size: 5vw;
}
<div class="card_body">
<div>
<div class="card word_shadow2">
<div class="card-header">
RANKING
</div>
<div class="card-body" id="star-box">
<div class="star-list">
<p class="rank">1</p>
<img
src="https://api.buzzanglemusic.com/images/artists/771"
alt="Placeholder image"
/>
<span class="media-content">
Eagles
</span>
</div>
</div>
</div>
</div>
</div>
I just enclosed the ranking number in a p tag and then gave it an id and then set the left and right margins to 40px.
.star-list {
display: flex;
align-items: center;
padding: 5px;
width: 680px;
-webkit-box-shadow: 0 10px 6px -6px #777;
-moz-box-shadow: 0 10px 6px -6px #777;
box-shadow: 0px 10px 20px -6px #1abc9c;
background-color: #fff;
border-radius: 10px;
height: 155px;
margin-top: 20px;
margin-left: 10px;
margin-bottom: 10px;
font-size: 5vw;
}
.star-list > img {
height: 140px;
border-radius: 10px;
}
.star-list > .media-content {
width: 1000px;
display: flex;
justify-content: center;
font-weight: 600;
font: black;
font-size: 5vw;
}
#ranking {
margin-right: 40px;
margin-left: 40px;
}
<div class="card_body">
<div>
<div class="card word_shadow2">
<div class="card-header">
RANKING
</div>
<div class="card-body" id="star-box">
<div class="star-list">
<p id="ranking">1</p>
<img
src="https://api.buzzanglemusic.com/images/artists/771"
alt="Placeholder image"
/>
<span class="media-content">
Eagles
</span>
</div>
</div>
</div>
</div>
</div>
img { /* reasonable defaults site-wide */
display: block;
width: 100%;
height: auto;
}
picture {
display: block; /* inline by default :/ */
}
.parent {
display: flex;
flex-direction: row;
align-items: center;
border: 1px solid red;
padding: 10px;
}
.parent picture {
max-width: 150px; /* let the image parent determine it's size */
margin: 0 10px; /* just to give a little space between text */
}
<div class='parent'>
<h3 class='rank'>10</h3>
<picture>
<img src='https://placehold.it/600x300'>
</picture>
<h2 class='name'>#sheriffderek</h2>
</div>
So, anything within a parent - can be organized with flex - as long as they are direct children! Fun!!!

Resizing a picture in <div> next to a sidebar

I need to place a picture in a box on the right of the sidebar. div-box has certain size and border.
If i set the style to a picture, it enlarges to the size of the box, when i need it to be 100%.
If i set the style to a box, the box' borders expand to a sidebar.
Please advise.
.sidebar {
background: white;
height: 240px;
width: 240px;
float: left;
padding: 40px 46px 46px 46px;
}
.sidebar-button{
display: block;
height: 28px;
width: 240px;
border-top: #c8c8c8 1px solid;
border-right: #c8c8c8 1px solid;
border-left: #c8c8c8 1px solid;
padding-left: 20px;
text-decoration: none;
font-size: 15px;
color: gray;
padding-top: 12px;
}
.auto {
border-bottom: #c8c8c8 1px solid;
}
.sidebar-button:hover{
background-color: #f9f9f9;
color: black;
padding-left: 40px;
width: 220px;
}
.bike-picture {
border: #c8c8c8 1px solid;
margin: 40px 46px 46px 26px;
width: auto;
height: 400px;
padding-top: 40px;
text-align: center;
}
<div class="sidebar">
<a class="sidebar-button" href="#">Ноутбуки</a>
<a class="sidebar-button" href="#">Планшеты</a>
<a class="sidebar-button" href="#">Телефоны</a>
<a class="sidebar-button" href="#">Телевизоры</a>
<a class="sidebar-button" href="#">Бытовая техника</a>
<a class="sidebar-button auto" href="#">Автотовары</a>
</div>
<div class="bike-picture">
<img src="img/bike.png" alt="Bike">
</div>
enter image description here
check this one:
.container{
display: -webkit-flex;
display: flex;
-webkit-flex-flow: row nowrap; /* Safari 6.1+ */
flex-flow: row nowrap;
-webkit-align-items: flex-start; /* Safari 7.0+ */
align-items: flex-start;
padding: 40px 0 46px 0;
background-color: white;
}
.sidebar {
height: 240px;
flex-basis: 240px;
padding: 0 46px 0 46px;
}
.sidebar-button{
display: block;
height: 28px;
width: 240px;
border-top: #c8c8c8 1px solid;
border-right: #c8c8c8 1px solid;
border-left: #c8c8c8 1px solid;
padding-left: 20px;
text-decoration: none;
font-size: 15px;
color: gray;
padding-top: 12px;
}
.auto {
border-bottom: #c8c8c8 1px solid;
}
.sidebar-button:hover{
background-color: #f9f9f9;
color: black;
padding-left: 40px;
width: 220px;
}
.bike-picture {
border: #c8c8c8 1px solid;
flex-grow: 1;
text-align: center;
}
.bike-picture img{
max-width: 100%;
}
<div class="container">
<div class="sidebar">
<a class="sidebar-button" href="#">Ноутбуки</a>
<a class="sidebar-button" href="#">Планшеты</a>
<a class="sidebar-button" href="#">Телефоны</a>
<a class="sidebar-button" href="#">Телевизоры</a>
<a class="sidebar-button" href="#">Бытовая техника</a>
<a class="sidebar-button auto" href="#">Автотовары</a>
</div>
<div class="bike-picture">
<img src="http://s12.postimg.org/fpyql332l/felt_bicycles_q26_194648_1.jpg" alt="Bike">
</div>
</div>

Trying to write text in a div with asymmetric sides (slanted rectangle) but it's stretched between 2 lines, why?

This is code what I'm trying to do: http://codepen.io/anatoly314/pen/Vebexq
Why my header: Hello World! catches two line instead of one? I've tried to play with width on .menu-header class but it didn't make any difference?
This is html part:
<div class="cell">
<div class="menu-item box_shadow">
<div class="menu-image-container"></div>
<div class="menu-header-container">
<span class="menu-header">Hello World!</span>
</div>
<div class="menu-content-container">
<ul>
<li>First</li>
<li>Second</li>
<li>Third</li>
</ul>
</div>
</div>
</div>
And CSS part:
.cell{
min-height: 100vh;
background-color: #FDDFD3;
vertical-align: middle;
display: flex;
justify-content: center;
}
.menu-item{
height: 80vh;
background-color: grey;
align-self: center;
width: 20vw;
border-radius: 25px;
}
.box_shadow {
-webkit-box-shadow: 0px 0px 4px 0px grey;
box-shadow: 0px 0px 4px 0px grey;
}
.menu-image-container{
height: 50%;
background-color: #fff;
border-top-left-radius: 25px;
border-top-right-radius: 25px;
}
.menu-header-container{
border-top: 40px solid white;
border-right: 20vw solid yellow;
height: 10%;
}
.menu-header{
position: relative;
left: 15vw;
top: -5vh;
}
.menu-content-container{
height: 40%;
direction: rtl;
}
you can use
.menu-header {
position: relative;
left: 15vw;
top: -5vh;
white-space: nowrap;
}
but I'm not sure if this is what you want.