2013-02-07 78 views
2

因此,我對此感到陌生,並試圖修改Windows CE設備上的代碼以使文本在按鈕中垂直顯示。按鈕中的垂直文本

我的代碼是:

.philips_menu_button { 
BACKGROUND-IMAGE : url(dynalite/images/buttons/philips/Philips_Button_Menu.png); 
TEXT-ALIGN : center; 
WIDTH : 128px; 
HEIGHT : 32px; 
COLOR : #07529c; 
FONT-WEIGHT : 600; 
dynalite-type : button-theme; 
upImage : dynalite/images/buttons/philips/Philips_Button_Menu.png; 
downImage : dynalite/images/buttons/philips/Philips_Button_Menu_pressed.png; 
text-offsety : 0; 
text-offsetx : 0; 
} 

<dynalite:button style="BACKGROUND-IMAGE: none; POSITION: absolute; WIDTH: 80px; HEIGHT: 70px; FONT-SIZE: 20px; OVERFLOW: hidden; TOP: 230px; LEFT: 700px; dont_layout: true; textid: Button_0001_txt; Button_0001_txt: " id=Button_0001 class="philips_menu_button swap_page" onclick="TouchPanel.GoToPage('./Edit Presets.html')" alpha="False" ATOMICSELECTION="true" text="Edit<br>&#10;Levels"> 
     <IMG style="POSITION: absolute; VISIBILITY: inherit; TOP: 0px; LEFT: 0px" id=Button_0001_img src=".\dynalite\images\buttons\philips\philips_button_menu.png" width=80 height=70> 
     <IMG style="POSITION: absolute; VISIBILITY: hidden; TOP: 0px; LEFT: 0px" id=Button_0001_img_1 src=".\dynalite\images\buttons\philips\philips_button_menu_pressed.png" width=80 height=70> 
       <DIV style="Z-INDEX: 998; POSITION: absolute; OVERFLOW: visible; TOP: 50%; LEFT: 0px"> 
        <DIV style="Z-INDEX: 999; POSITION: relative; WIDTH: 80px; TOP: -50%; LEFT: 0px" id=Button_0001_txt>Edit 
         <BR>Levels 
        </DIV> 
       </DIV> 

基本上屏幕被設計爲橫向模式,但我想通過90度旋轉。我可以處理不必旋轉按鈕或文本。

在此先感謝。

史蒂夫

回答

3

如果你想旋轉就可以使用與變換的CSS方法..按鈕

<input type="button" value="edit" style="transform:rotate(7deg); 
-ms-transform:rotate(90deg); /* IE 9 */ 
-moz-transform:rotate(90deg); /* Firefox */ 
-webkit-transform:rotate(90deg); /* Safari and Chrome */ 
-o-transform:rotate(90deg); /* Opera */"/> 

如果你希望文字,而不是旋轉顯示直立,一個選擇是使用jQuery的..

HTML的一部分:

<input type="button" value="edit" id="vert" style="width:1.5em;"> 

jQuery的一部分:

$(document).ready(function() { 
     $('#vert').val('e\nd\ni\nt'); 
     }); 

看看這裏.. http://codepen.io/lukeocom/pen/mHnvl