jQueryMobile 問い合わせフォームの作成02
入力フォームの装飾と調整
- ページの見出し(h2要素)とフォームの間には不自然な余白があり、入力フォームの背景色がやや暗いので、デザインを少し調整する
ソースコード【 HTML 】
<!DOCTYPE html> <html lang="ja"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1"> <title>jQuery Mobile Sample</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css"> <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script> <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.js"></script> <style> /*入力フォームの背景を調整*/ textarea.ui-body-b,input.ui-body-b{ background-color:white; } /*見出しとフォーム部品の間の余白を調整*/ .ui-field-contain:first-child{ padding-top:0; } </style> </head> <body> <div data-role="page" id="contact" data-theme="c"> <div data-role="header" data-theme="b"> <a href="#index" data-icon="arrow-l" data-direction="reverse">TOP</a> <h1>スマートフォン</h1> </div> <div data-role="content"> <div data-role="fieldcontain"> <label for="name">名前</label> <input type="text" id="name"> </div> </div> <div data-role="footer" data-theme="b"> <h4>© 2012 スマートフォン</h4> </div> </div> </body> </html>
ブラウザで表示【 Safari 】