SPANS do not rotate with Rotate and direction inside the LI

Asked

Viewed 46 times

0

I got the following código down below:

ul {
	width: 802px;
	list-style: none;
	border: .1px #000 solid;
	padding: 0;
}
ul#tabela {		
	height: 200px;
}
ul#retornos {		
	height: 30px;
}
ul li {
	height: 100%;
	float: left;
	text-align: center;
	border-right: .1px #000 solid;
}	
ul li:last-child {
	border-right: none;
}
ul#tabela li span {
	font-weight: bolder;
	line-height: 30px;
}
ul#tabela li span.normal {	
	vertical-align: middle;
}
ul#tabela li span.vertical {
	width: 200px;
	direction: rtl;
	transform: rotate(90deg);
}
 
<ul id='tabela'>
	<li style='width:100px;'><span class='normal'>Nome do Gcéu</span></li>
	<li style='width:100px;'><span class='vertical'>Supervisor</span></li>
	<li style='width:100px;'><span class='normal'>Líder</span></li>
	<li style='width:050px;'><span class='vertical'>Houve Supervisão?</span></li>
	<li style='width:050px;'><span class='vertical'>Houve dia de jejum?</span></li>
	<li style='width:050px;'><span class='vertical'>Houve dia de evangelismo?</span></li>
	<li style='width:050px;'><span class='vertical'>Membros Compromissados</span></li>
	<li style='width:050px;'><span class='vertical'>Visitantes</span></li>
	<li style='width:050px;'><span class='vertical'>Crianças de 0 a 12 anos</span></li>
	<li style='width:050px;'><span class='vertical'>Total de presentes</span></li>
	<li style='width:050px;'><span class='vertical'>Ofertas</span></li>
	<li style='width:050px;'><span class='vertical'>Discipulados</span></li>
	<li style='width:050px;'><span class='vertical'>Número de Decisões</span></li>	
</ul>

I’d like to know why the spans NAY are rotating and how correct that.

  • 1

    Boy, but hadn’t you already solved it? :D

  • I had to change the way to do because I’m having problems with mPDF that does not accept the css

1 answer

1


Inline elements cannot be rotated. Spans are inline elements by default, forcing display:block or display:inline-block in its element the rotation will work.

Another way is to use rotation based on the element. As exemplified below:

ul {
  width: 850px;
  list-style: none;
  border: .1px #000 solid;
}

ul#tabela {
  height: 200px;
}

ul li {
  height: 100%;
  float: left;
  text-align: center;
  vertical-align: middle;
  border-right: .1px #000 solid;
}

ul li:last-child {
  border-right: none;
}

ul#tabela li span.vertical {
  width: 200px;
  transform: rotate(-90deg);
  transform-origin: right top 0;
  float: right;
  text-align: right;
  margin: 5px 25px 0px 0px;
}
<ul id='tabela'>
  <li style='width:100px;'><span class='normal'>Nome do Gcéu</span></li>
  <li style='width:100px;'><span class='vertical'>Supervisor</span></li>
  <li style='width:100px;'><span class='normal'>Líder</span></li>
  <li style='width:050px;'><span class='vertical'>Houve Supervisão?</span></li>
  <li style='width:050px;'><span class='vertical'>Houve dia de jejum?</span></li>
  <li style='width:050px;'><span class='vertical'>Houve dia de evangelismo?</span></li>
  <li style='width:050px;'><span class='vertical'>Membros Compromissados</span></li>
  <li style='width:050px;'><span class='vertical'>Visitantes</span></li>
  <li style='width:050px;'><span class='vertical'>Crianças de 0 a 12 anos</span></li>
  <li style='width:050px;'><span class='vertical'>Total de presentes</span></li>
  <li style='width:050px;'><span class='vertical'>Ofertas</span></li>
  <li style='width:050px;'><span class='vertical'>Discipulados</span></li>
  <li style='width:050px;'><span class='vertical'>Número de Decisões</span></li>
</ul>

  • So, is it possible to envy the position of the text? it is moved from left to right and from top to bottom, I would like the opposite. But watch what will happen with the question signs. It is necedsário also centralize the spans within the vetical li’s and horizontally!

  • @Carlosrocha , his question is about the pq the rotation does not occur. I believe that with the explanation above his doubt has been resolved. I edited the snippet by adjusting the rotation. The demo was just to solve what you’re trying to develop. Just use the section and center as needed.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.