css - vertical text in flexbox layout -


i have front page layout portfolio im trying implement vertical text on. right section (blue) name written vertically. when try rotate text via css transform, screws layout when scrolling. im stumped. youll have increase size full page view layout correctly. name should extend full length of blue container. https://codepen.io/marti2221/pen/bdrdzj

<div class="container">  <div class="left"> <div class="svg-container">   <div class="svg-logo"></div> </div> <div class="question-container">   <p>who i?</p>   <p>what do?</p> </div> </div> <div class="middle"> <div class="top">   <nav>     <a>link1</a>     <a>link2</a>     <a>link3</a>     <a>link4</a>   </nav> </div> <div class="bottom">   <h1>im extremely</br> passionate user</br> interface design</br> +  developer</h1> </div> </div> <div class="right"> <h1></h1> </div> </div>    .container{ display: flex; height: 100vh; background: black; }    .left{ display: flex; flex: 1; background: gray; flex-direction: column; justify-content: space-between; align-items: center; } .svg-container{ display: flex; flex-grow: 1; background: yellow; width: 100%;  justify-content: center;  } .svg-logo{ height: 100px; width: 200px; background: orange; } .question-container{ display: flex; flex-grow: 1; background: green; width: 100%; flex-direction: column; justify-content: flex-end; align-items: flex-end; } p{ display: flex; margin-right: 10px; }    .middle{ display: flex; flex: 3; background: red; flex-direction: column; } .top{ display: flex; flex: 1; background: aqua; } nav{ display: flex; flex-direction: column; margin: 65px 0 0 65px; }  a:before { content: '\2014'; position: absolute; margin-left: -40px; }  a{ margin: 10px 0 10px 0; font-size: 24px; }   .bottom{ display: inline-flex; flex: 1; background: brown; align-items: flex-start; } h1{  margin-left: 25px; font-size: 55px; }   .right{ display: flex; flex: .5; background: blue; }  .name{ transform: rotate(90deg); } 

sideways-lr alone (without transform) solve it, though of today firefox support it.

use writing-mode: vertical-lr; in combination transform: rotate , behave more expect

updated codepen

stack snippet

.container{    display: flex;    height: 100vh;    background: black;  }        .left{    display: flex;    flex: 1;    background: gray;    flex-direction: column;    justify-content: space-between;    align-items: center;  }  .svg-container{    display: flex;    flex-grow: 1;    background: yellow;    width: 100%;    justify-content: center;  }  .svg-logo{    height: 100px;    width: 200px;    background: orange;  }  .question-container{    display: flex;    flex-grow: 1;    background: green;    width: 100%;    flex-direction: column;    justify-content: flex-end;    align-items: flex-end;  }  p{    display: flex;    margin-right: 10px;  }        .middle{    display: flex;    flex: 3;    background: red;    flex-direction: column;  }  .top{    display: flex;    flex: 1;    background: aqua;  }  nav{    display: flex;    flex-direction: column;    margin: 65px 0 0 65px;  }    a:before {    content: '\2014';    position: absolute;    margin-left: -40px;  }  a{    margin: 10px 0 10px 0;    font-size: 24px;  }      .bottom{    display: inline-flex;    flex: 1;    background: brown;    align-items: flex-start;  }  h1{    margin-left: 25px;    font-size: 55px;  }      .right{    display: flex;    flex: .2;    background: blue;    flex-direction: column;    justify-content: center;  }    .name{    display: flex;    transform: rotate(-180deg);            /*  changed  */    background: pink;    writing-mode: tb-lr;                   /*  ie  */    writing-mode: vertical-lr;             /*  added  */  }
<div class="container">    <div class="left">      <div class="svg-container">        <div class="svg-logo"></div>      </div>      <div class="question-container">        <p>who i?</p>        <p>what do?</p>      </div>    </div>    <div class="middle">      <div class="top">        <nav>          <a>link1</a>          <a>link2</a>          <a>link3</a>          <a>link4</a>        </nav>      </div>      <div class="bottom">        <h1>im extremely</br> passionate user</br> interface design</br> + developer</h1>      </div>    </div>    <div class="right">      <h2 class="name">travis martin</h2>    </div>  </div>


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -