Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical Button using CSS

Tags:

html

css

I'm trying to build a vertical button but I not able to put the text in only one line.

enter image description here

Until now I have:

Any idea how can I push down the text and put it in only one line?

#hp-ctn-howItWorks
{
    position:fixed;
    top:50px;
    right: 0px;
    padding:0px;
    margin:0px;
    width: 40px;
    height:160px;
    background:#FF931E;
    z-index:15;
    border-radius: 3px 0px 0px 3px;
}

#hp-ctn-howItWorks img
{
    margin: 15px 0px 0px 13px;
}

#hp-ctn-howItWorks p
{
    color: #fff;
    -moz-transform:rotate(-90deg);
    -ms-transform:rotate(-90deg);
    -o-transform:rotate(-90deg);
    -webkit-transform:rotate(-90deg);
}
<div id="hp-ctn-howItWorks">
    <img src="~/Content/images/ui-symb-arrow-left-white-15x15.png" width="15" height="15" />
    <p>Como funciona</p>
</div>
like image 897
Patrick Avatar asked Oct 27 '14 17:10

Patrick


People also ask

How do I arrange a button vertically in CSS?

While we can vertically center the button element using the CSS property justify-content along with the value center. If we want to center a button element both horizontally and vertically then we have to specify both the CSS property justify-content and align-items along with the value center .

How do I align two vertical buttons in CSS?

You can use the align-items property to align vertically in CSS Flex.

How do I arrange a button in HTML?

Block button element w/ static width Even though it's only 200px, it won't let any other elements be next to it. You can center a block level element by setting margin-left and margin-right to auto . We can use the shorthand margin: 0 auto to do this. (This also sets margin-top and margin-bottom to zero.)


1 Answers

demo - http://jsfiddle.net/victor_007/m1c5xazr/1/

rotate the buttom instead of text

#hp-ctn-howItWorks img {
    vertical-align:middle;
}
#hp-ctn-howItWorks {
    padding:0px 0px 0px 0px;
    text-align: center;
    margin:0px;
    width: 160px;
    height:40px;
    background:#FF931E;
    z-index:15;
    border-radius: 5px 5px 0px 0px;
    -moz-transform:rotate(-90deg);
    -ms-transform:rotate(-90deg);
    -o-transform:rotate(-90deg);
    -webkit-transform:rotate(-90deg);
    transform-origin: bottom right;
    position: fixed;
    right: 0px;
}
#hp-ctn-howItWorks p {
    color:#fff;
    display:inline-block;
    line-height:40px;
}
like image 74
Vitorino fernandes Avatar answered Sep 25 '22 23:09

Vitorino fernandes