0

Unable to rotate the text. The gray div width has to be 50. Using Chrome.

http://jsfiddle.net/NLfaz/1/

HTML:

<div class="divContactInfo">
    <div class="tabHeader">
        <span class="textRotate">My Contact Info</span>
    </div>
</div>

CSS:

.divContactIno
{
position:fixed;
    right:0;
    border:1px solid red;
    top:49%;
    width:350px;
    height:500px;
}
.divContactInfo .tabHeader
{
border:1px solid gray;
    width:50px;
    height:120px;
}
.textRotate
{
  -webkit-trasform:rotate(-90deg);
    -moz-trasform:rotate(-90deg);
}
3
  • 2
    your css is misspelled.. --> trasform <-- Commented Mar 2, 2014 at 7:28
  • The text has to be in a single line, and the div width to be 50px. Is this possible. Commented Mar 2, 2014 at 7:31
  • check my answer for that. Commented Mar 2, 2014 at 7:35

4 Answers 4

2

In response to your comment.. Try this

.textRotate {
    display: block;
    white-space: pre;
    left: 10px;
    margin-top: 80px;

    -webkit-transform: rotate(-90deg);
    -moz-transform: rotate(-90deg);
    -o-transform: rotate(-90deg);
    -ms-transform: rotate(-90deg);
    transform: rotate(-90deg);
    }
Sign up to request clarification or add additional context in comments.

Comments

2

You cannot rotate an inline element, and you need to spell transform correctly.

.textRotate {
    display: inline-block;
    -webkit-transform:rotate(-90deg);
    -moz-transform:rotate(-90deg);
}

Note that you also misspelled divContactInfo as divContactIno.

http://jsfiddle.net/mattball/R7bQn/

1 Comment

Thank you , but the text has to be in single line. I would like the div width to stay 50 as I have to style it later.
1

try add propertydisplay and then use Rotate:

.divContactInfo
{
position:fixed;
    right:0;
    border:1px solid red;
    top:49%;
    width:350px;
    height:500px;
}
.divContactInfo .tabHeader
{
border:1px solid gray;
    width:50px;
    height:120px;
}


.textRotate {
display:block;
/* Safari */
-webkit-transform: rotate(-90deg);

/* Firefox */
-moz-transform: rotate(-90deg);

/* IE */
-ms-transform: rotate(-90deg);

/* Opera */
-o-transform: rotate(-90deg);

/* Internet Explorer */
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=3);

}

http://jsfiddle.net/NLfaz/3/

1 Comment

Thank you , but the text has to be in single line. I would like the div width to stay 50 as I have to style it later.
0
    .divContactInfo
    {
    position:fixed;
        right:0;
        border:1px solid red;
        top:49%;
        width:350px;
        height:500px;
    }
    .divContactInfo .tabHeader
    {
    border:1px solid gray;
        width:50px;
        height:120px;
    }
    .textRotate
    {
        display:block;
      -webkit-transform:rotate(-90deg);
        -moz-transform:rotate(-90deg);
    }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.