I need vertical button with written vertical text inside. It should not be turned to 90 degree. I need to add some hover effect to right side if mouse on it and give white space between words. I have tried white-space
and word-space
but it did not help.
Example:
JavaScript
x
38
38
1
.button {
2
border-radius: 4px;
3
background-color: #f4511e;
4
border: none;
5
color: #FFFFFF;
6
text-align: center;
7
font-size: 28px;
8
padding: 20px;
9
width: 200px;
10
transition: all 0.5s;
11
cursor: pointer;
12
margin: 5px;
13
}
14
15
.button span {
16
cursor: pointer;
17
display: inline-block;
18
position: relative;
19
transition: 0.5s;
20
}
21
22
.button span:after {
23
content: '0bb';
24
position: absolute;
25
opacity: 0;
26
top: 0;
27
right: -20px;
28
transition: 0.5s;
29
}
30
31
.button:hover span {
32
padding-right: 25px;
33
}
34
35
.button:hover span:after {
36
opacity: 1;
37
right: 0;
38
}
JavaScript
1
2
1
<script src="http://d3js.org/d3.v3.min.js"></script>
2
<button class="button" style="width:60px; height:600px; text-align:center;"><div style="width: 1ch; text-align:center; font: Consolas, Monaco, monospace;font-size:14pt; word-wrap: break-word;white-spacing: 3 px;">Online Sürücü Sifariş Et</div></button>
Advertisement
Answer
I think this is what you want. The button is a vertical button and the text is all one letter below the next. I have used <br>
tags for every new line. Have a look
JavaScript
1
38
38
1
.button {
2
border-radius: 4px;
3
background-color: #f4511e;
4
border: none;
5
color: #FFFFFF;
6
text-align: center;
7
font-size: 28px;
8
padding: 20px;
9
width: 200px;
10
transition: all 0.5s;
11
cursor: pointer;
12
margin: 5px;
13
}
14
15
.button span {
16
cursor: pointer;
17
display: inline-block;
18
position: relative;
19
transition: 0.5s;
20
}
21
22
.button span:after {
23
content: '0bb';
24
position: absolute;
25
opacity: 0;
26
top: 0;
27
right: -20px;
28
transition: 0.5s;
29
}
30
31
.button:hover span {
32
padding-right: 25px;
33
}
34
35
.button:hover span:after {
36
opacity: 1;
37
right: 0;
38
}
JavaScript
1
2
1
<script src="http://d3js.org/d3.v3.min.js"></script>
2
<button class="button" style="width:60px; height:600px; text-align:center;"><div style="width: 1ch; text-align:center; font: Consolas, Monaco, monospace;font-size:14pt; word-wrap: break-word;white-spacing: 3 px;">O<br>n<br>l<br>i<br>n<br>e<br><br>S<br>ü<br>r<br>ü<br>c<br>ü<br><br>S<br>i<br>f<br>a<br>r<br>i<br>ş<br><br>E<br>t<br></div></button>