По какой-то причине кнопка под текстовыми полями становится шире, чем текстовые поля, чем больше я изменяю размер окна браузера. Любые идеи почему?jQuery mobile button stretching too far
SCRN:
HTML:
<!DOCTYPE html>
<html>
<head>
<title>Title</title>
<script src="scripts/ajax.js"></script>
<link rel="stylesheet" href="css/custom.css" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>
<body>
<div data-role='page' id='confirmDetails' data-add-back-btn='true' data-theme='a'>
<div data-role='header' data-position='fixed'><h1>Confirm Details</h1></div>
<div class='ui-body ui-body-e'><p><strong>Please recheck your details to make sure they are correct, then press confirm.</strong></p></div>
<div data-role='content'>
<div><label>Name</label><input type='text' value='Some factor name' disabled /></div>
<div><label>VAT No</label><input id='txtFVATNo' type='text' value='121212121' placeholder='vat no' /></div>
<div><label>Email</label><input id='txtFEmail' type='email' value='[email protected]' autocapitalize='none' placeholder='email address' /></div>
<div><label>Name</label><input id='txtFContactName' type='text' value='Muhammad' autocapitalize='words' placeholder='contact name' /></div>
<input type='submit' id='btnConfirm' value='Everything Correct - Confirm!' data-icon='check' data-iconpos='right' /></div>
</div>
</body>
</html>
EDIT:
Настройка пользовательских CSS для #confirmButton к ширине 97% не работали,
Это не работал либо:
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
Вот CSS для кнопки:
webkit-appearance: none;
-webkit-box-align: center;
-webkit-rtl-ordering: logical;
-webkit-user-select: text;
background-attachment: scroll;
background-clip: border-box;
background-color: rgba(255, 255, 255, 0);
background-image: none;
background-origin: padding-box;
border-bottom-color: black;
border-bottom-style: none;
border-bottom-width: 0px;
border-left-color: black;
border-left-style: none;
border-left-width: 0px;
border-right-color: black;
border-right-style: none;
border-right-width: 0px;
border-top-color: black;
border-top-style: none;
border-top-width: 0px;
box-sizing: border-box;
color: black;
cursor: pointer;
display: block;
filter: none;
font-family: Helvetica, Arial, sans-serif;
font-size: 1px;
font-style: normal;
font-variant: normal;
font-weight: normal;
height: 39px;
left: 0px;
letter-spacing: normal;
line-height: normal;
margin-bottom: 0px;
margin-left: 0px;
margin-right: 0px;
margin-top: 0px;
opacity: 0.10000000149011612;
padding-bottom: 1px;
padding-left: 6px;
padding-right: 6px;
padding-top: 1px;
position: absolute;
text-align: center;
text-decoration: none;
text-indent: -9999px;
text-shadow: none;
text-transform: none;
top: 0px;
white-space: pre;
width: 391px;
word-spacing: 0px;
z-index: 2;
SCREENSHOT (для меня болит голова):
РЕШЕНИЕ:
Это работает с последней версией 1.1.0.
input.ui-input-text, textarea.ui-input-text {
width: 100% !important; /* used to be width: 97%; */
/* add box sizing so padding is included in width */
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Как уже упоминалось в ответах, заполнение и размеры, установленные на '100%', не ладят друг с другом. В этом случае, если там действительно есть прокладка, которая, скорее всего, будет, я бы установил '#btnConfirm {width: 100%; padding: 5px 0px 5px 0px; } 'потому что в этом случае вам действительно не нужно заполнять по бокам. – Joonas
hi lollero, извините, но не работаю. – sprocket12
Кнопка имеет статическую ширину? Это 'element.style', который, возможно, генерируется jquery-mobile или css, который вы установили для кнопки? .. и если это не css, который вы установили в вашем файле css, добавьте это также. .. и то, что он сказал ниже ↓ – Joonas