I would like to align a form header text that I rotate -90° from CSS on the top and left of it column div. Basically, I rotate it and stick it against the related form that is on the right.
The thing is that, depending on the header text length, I will not have the same results if I use top:50%;
on the form header DOM node. I made a picture to make it clearler :
As you can see, a container column align the form in the current page in both logo and form rows. The form row (after the logo) must have the fields centred on the main page, and display the form header in the left offset space.
If main form header text is longer, I get a result like this:
The main structure is then like this (className
stands for class
, I am using React) in what I tried so far:
<div className='container'>
<!-- logo container -->
<div className='row'>
<div className='col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4 text-center'>
<br/>
<img src='/img/logo.svg' className='logo_img' />
</div>
</div>
<!-- form container -->
<div className='row'>
<div className='col-xs-12 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4 text-center'>
<!-- here I add 2 tested columns for the form internal layout -->
<div className='col-xs-1 col-sm-1 ...'>
<h1 className='formHeader'>Form Header</h1>
</div>
<div className='col-xs-10 ...'>
<!-- here I put my form fields and submit button -->
</div>
</div>
I tried various approaches:
- The version above: if I put the header in its own column, it allows me to be sure it will be well positioned in width whatever the screen size is, but the column being too small in height (only one
h1
before rotation is inside), I end up not being able to align it vertically - If I put the header in the main form column, and I put the form in a nested column with offset (header is pulled left and positioned after the form fields column) I almost get what I want by playing with the display and position css properties but it does not solve the issue for any length of form header, it is specific to the actual header text length. Besides, I can't align top left the header on the left part of my form column.
Please don't hesitate to require more details.