I am using a sidebar alongside fullscreen.js, that detects which section is currently active/being viewed and displays the title rotated 90 degrees, along a vertical axis.
Because the text is dynamic, the length varies. This is causing problems with styling as the text is rotated: the longer the text, the further away from the left margin it appears, overflowing its boundaries.
If you use the mousewheel to move donw on this example a few sections you will see what is happening: http://jsfiddle.net/pLjrbcL7/2/
some of the CSS I am using to style this element is here:
.vertical-text {
-ms-transform: rotate(270deg);
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg);
transform: rotate(270deg);
font-family:'Raleway', sans-serif;
float: left;
font-weight: 300;
font-size:12px;
}
#titleposition {
position: absolute;
top: 160px;
left:5px;
white-space: nowrap;
}
im using white-space:nowrap to force all of the text to appear on a single line.
how can i style this span (id="collapsedsectiontitle") so that it always appears in the centre of the sidebar, anchored at the top, regardless of length?
add to '#titleposition'
top: 200px;
(or other distance from the '#menuarrow' to prevent conflict on the positions). give it alsoleft :50%;
for placing it in the middle of '#undermenu'. give '.vertical-text'position: absolute;
too and replace thefloat: left;
withwidth: 100%;
. for your request to make the text of '#titleposition' start from the right side, give itdirection: rtl;
, so we have:the new result: http://jsfiddle.net/pLjrbcL7/4/