1

私のコードは次のとおりです

<div data-role="content" id="div1" align="top" style="padding:3 !important;" >  
        <table border="0" align="CENTER" cellspacing="0" width="100%" style="vertical-    align: text-bottom;" >
        <tr>
        <td></td>
        <td>
            <div id="question1" class="question">
                <input type="text" id="question" />
            <Style>
                #question{
                  font:5px;
                  font-family:verdana;
                }
            </style>        
            </div>
        </td></tr><tr>
        <td width="50"><img id="img2" width="40" height="36" style="float:right; margin-top: 0px;" ></td>
        <td style="text-align:center;">
            <div class="ui-grid-b" >
                <div class="ui-block-a"><button id="button1" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>
                <div class="ui-block-b"><button id="button2" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>   
                <div class="ui-block-c"><button id="button3" type="submit" data-theme="b" style="font-size:0.8em;"></button></div>  
            </div>
        </td>
        </tr>
        </table>
</div>

上記のコード ブロックの次のコード行

<input type="text" id="question" />

値がjQueryを介して入力されるとき、私がしているのは

$('.question').text(questionText);

これを iPhone で表示すると、テキストが幅よりも長くなると次の行に移動します。複数行を持つ HTML タグは textarea だけだと思いました。ここのテキストが複数行になる理由がわかりません。また、それを回避するにはどうすればよいですか? テキストが途切れてもかまいませんが、複数行にしたくありません。

4

2 に答える 2

0

今のところ修正した方法は、次のことを行いました

<div id="question1" class="question" style="height: 12px;">
            <input type="text" id="question" />
        <Style>
            #question{
              font:5px;
              font-family:verdana;
            }
        </style>        
        </div>

少なくとも複数行が消えるようになりましたが、もっとエレガントな方法があれば (jQuery の省略記号はいいようですが、うまくいきませんでした)、教えてください。

于 2013-04-19T04:19:37.130 に答える