Форум программистов, компьютерный форум, киберфорум
HTML, CSS
Войти
Регистрация
Восстановить пароль
Блоги Сообщество Поиск Заказать работу  
 
 Аватар для Юлия1992
35 / 7 / 1
Регистрация: 02.10.2011
Сообщений: 84

Расположыть два input в одной строке

17.10.2013, 14:56. Показов 7632. Ответов 0
Метки нет (Все метки)

Студворк — интернет-сервис помощи студентам
Доброго времени суток
И так, нужно напутствие в правильном размещении двух input в одной строке.

Есть страница:
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<!DOCTYPE  HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 
    <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type"></meta>
    <title>Search ticket</title>
      <link rel="stylesheet" href="css/bootstrap.min.css"/>
      <link rel="stylesheet" href="css/font-awesome.min.css"/>
      <link rel="stylesheet" type="text/css" href="SearchT.css"/>
    
 
    <form class="form-3" name="searcht">
    <h1 id="h" >Search ticket</h1>
    <fieldset id="my_field">
    <p class="field">
        <input type="text" name="anumb" placeholder="Accountnumber"/>
        <i class="icon-user icon-large"></i>
    </p>
        <p class="field">
        <input type="text" name="username" placeholder="Username">
        <i class="icon-user icon-large"></i>
    </p> 
    <p class="field">
        <input type="text" name="aname" placeholder="Accountname">
        <i class="icon-user icon-large"></i>
    </p>     
    <p class="field">
        <input type="text" name="cpeid" placeholder="CPE ID">
        <i class="icon-user icon-large"></i>
    </p>   
     <p class="submit">
        <button type="submit" name="submit"><i class="icon-arrow-right icon-large"></i></button>
    </p>
     </fieldset>
    </form>
    
 
</body>
</html>
CSS страницы:

CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/*Search CSS*/
body {
   margin: 0;
   }
 
 
.form-3 {
    width: 100%;
    height: 100%;
    margin: 0;
    position: fixed;
    
     /* For the submit button positioning */
    
    /* Styles */
    box-shadow:
        0 0 1px rgba(0, 0, 0, 0.3),
        0 3px 7px rgba(0, 0, 0, 0.3),
        inset 0 1px rgba(255,255,255,1),
        inset 0 -3px 2px rgba(0,0,0,0.25);
    background: linear-gradient(#7A378B, #FFBBFF 75%);
}
 
.form-3 .field {
    position: relative; /* For the icon positioning */
}
 
.form-3 .field i {
    /* Size and position */
    left:33%;
    top: 0px;
    position: absolute;
    height: 41px;
    width: 41px;
    /* Line */
    border-right: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.7);
    /* Styles */
    color: #AA6BAD;
    text-align: center;
    line-height: 42px;
    transition: all 0.3s ease-out;
    pointer-events: none;
}
 
 
.form-3 input[type=text],
.form-3 input[type=password] {
    margin-left: 33%;
    font-family: 'Lato', Calibri, Arial, sans-serif;
    font-size: 17px;
    font-weight: 400;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
 
    /* Size and position */
    width: 30%;
    padding: 10px 18px 10px 45px;
    /* Styles */
    border: none; /* Remove the default border */
    box-shadow:
        inset 0 0 5px rgba(0,0,0,0.1),
        inset 0 3px 2px rgba(0,0,0,0.1);
    border-radius: 6px;
    background: linear-gradient(#EED2EE, #FFE1FF 10%);
    color: #8B1C62;
    transition: color 0.3s ease-out;
}
 
.form-3 input[type=text] {
    margin-bottom: 15px;
    
}
 
.form-3 input[type=text]:hover ~ i,
.form-3 input[type=password]:hover ~ i {
    color: #52cfeb;
}
 
.form-3 input[type=text]:focus ~ i,
.form-3 input[type=password]:focus ~ i {
    color: #42A2BC;
}
 
.form-3 input[type=text]:focus,
.form-3 input[type=password]:focus,
.form-3 button[type=submit]:focus {
    outline: none;
}
   
/* Title forms*/
 
.form-3 #my_field {
   border: 0;
}
 
.form-3 #h {
    font-family: 'Lato', Calibri, Arial, sans-serif;
    font-size: 27px;
    font-weight: 20px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    color: #DDA0DD;
    position: relative;
    text-align: center;
    padding-left: 23px;
 
 }
 
.form-3 #h:after, h:before {
    position: absolute;
    background-color:  #DDA0DD;
    content: "";
    height: 1px;
    left:22%;
    top: 45px;
    width: 59%;   
    border-top: 1px solid rgba(0, 0, 0, 0.15);
    box-shadow: 1px 0 0 rgba(255, 255, 255, 0.7);
 
}
 
/*Button*/
 
.form-3 .submit {
    /* Size and position */
    width: 10%;
    height: 40px;
    position: relative;
    top: 75%;
    left: 45%;
    padding: 1px;
    z-index: 8;
    /* Styles */
    border: 3px;
    background: linear-gradient(270deg, #8B008B, #DDA0DD);
    box-shadow:
        0 0 2px rgba(0,0,0,0.1),
        0 3px 2px rgba(0,0,0,0.1),
        inset 0 -3px 2px rgba(0,0,0,0.2);
}
 
.form-3 .submit:after {
    /* Size and position */
    content: "";
    position: absolute;
    top: -2px;
    left: 30px;
    background: #ffffff;
    box-shadow: 0 62px white, -32px 31px white;
}
 
.form-3 button {
    /* Size and position */
    width: 100%;
    height: 100%;
    margin-top: -1px;
    /* Icon styles */
    font-size: 1.4em;
    line-height: 1.7;
    color: white;
    border: none; /* Remove the default border */
    border-radius: inherit;
    background: linear-gradient(#8B4789, #1C1C1C);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.3),
        0 1px 2px rgba(0,0,0,0.35),
        inset 0 3px 2px rgba(255,255,255,0.2),
        inset 0 -3px 2px rgba(0,0,0,0.1);
 
    cursor: pointer;
}
 
.form-3 button: hover,
.form-3 button[type=submit]:focus {
    background: #52cfeb;
    transition: all 0.3s ease-out;
}
 
.form-3 button:active {
    background: #8B668B;
    box-shadow:
        inset 0 0 5px rgba(0,0,0,0.3),
        inset 0 3px 4px rgba(0,0,0,0.3);
}

Также подключен FontAwesome (http://fontawesome.veliovgroup.com/).

Возникла потребность добавить к форме еще 4 дополнительных input.

Пробовала реализовать это таким образом:
HTML5
1
2
3
4
5
 <p class="field">
        <input type="text" name="anumb" placeholder="Accountnumber"/>
        <input type="text" name="datt" placeholder="Date"/>
        <i class="icon-user icon-large"></i>
    </p>
но второй input все-ровно подставляет под первый.
Что нужно дописать к CSS, чтоб input-ы были расположены как нужно.

Заранее благодарю за подсказку

Добавлено через 1 час 43 минуты
Решыла проблему путем помещения формы в таблицу:
HTML5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
 <table class="form-3">
    <form class="form-3" name="searcht">
    <tbody>
    <td>
    <p class="field">
        <input type="text" name="anumb" placeholder="Accountnumber"/>
        <i class="icon-file-text icon-large"></i>
    </p>
        <p class="field">
        <input type="text" name="username" placeholder="Username">
        <i class="icon-user icon-large"></i>
    </p> 
    <p class="field">
        <input type="text" name="aname" placeholder="Accountname">
        <i class="icon-user icon-large"></i>
    </p>     
    <p class="field">
        <input type="text" name="cpeid" placeholder="CPE ID">
        <i class="icon-user icon-large"></i>
    </p>   
     </fieldset>
     </td>
         <td>
    <fieldset id="my_field">
    <p class="field">
        <input type="text" name="anumb" placeholder="Accountnumber"/>
        <i class="icon-file-text icon-large"></i>
    </p>
        <p class="field">
        <input type="text" name="username" placeholder="Username">
        <i class="icon-user icon-large"></i>
    </p> 
    <p class="field">
        <input type="text" name="aname" placeholder="Accountname">
        <i class="icon-user icon-large"></i>
    </p>     
    <p class="field">
        <input type="text" name="cpeid" placeholder="CPE ID">
        <i class="icon-user icon-large"></i>
    </p>   
   
     </fieldset>
     </td>
     </tbody>
     </table>
       <p class="submit">
        <button type="submit" name="submit"><i class="icon-search icon-large"></i></button>
       </p>
    </form>
0
IT_Exp
Эксперт
34794 / 4073 / 2104
Регистрация: 17.06.2006
Сообщений: 32,602
Блог
17.10.2013, 14:56
Ответы с готовыми решениями:

Два форматирования в одной строке
Можно ли в одной строке часть текста выравнивать по левому краю, а другую часть по правому? (Имеется в виду без блоков, а попроще).

Два div`a в одной строке
Добрый день, объясните пожалуйста, в чем проблема? Как я понимаю, psot должен стать рядом с post в одной строке. .post {width: 80%;} ...

Два div на одной строке
Добрый вечер! Как сделать чтобы два div были в одной строке при этом мапились под окно браузера, и картинки в них тоже Использую...

0
Надоела реклама? Зарегистрируйтесь и она исчезнет полностью.
BasicMan
Эксперт
29316 / 5623 / 2384
Регистрация: 17.02.2009
Сообщений: 30,364
Блог
17.10.2013, 14:56
Помогаю со студенческими работами здесь

Как разместить два элемента в одной строке?
на сайте ..есть логотип ... логотип размещается в верхнем левом краю...на том же уровне только в правом краю нужно разместить фрейм как это...

Выстроить input и select на одной линии
Добрый день ув. пользователи! На стр. есть два блока с классом col-md-4 и col-md-2, внутри них разное кол-во элементов может быть.. можно ...

Запись положительных значений по два в одной строке
Написать программу записи положительных значений по два в одной записи. Записываемые значения вычисляются по формуле: значение n элемента...

Два listview.Items.Add в одной строке
Нужно в одной строке написать текст двумя разными цветами, делаю так listview1.Items.Add(&quot;text1 &quot;); ...

Как ввести данные с клавиатуры, в одной строке два поля?
Здравствуйте. Как ввести данные с клавиатуры, в одной строке два поля? То есть, например, в C++ есть cin, когда можно ввести одновременно...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
1
Ответ Создать тему
Новые блоги и статьи
http://iceja.net/ математические сервисы
iceja 20.01.2026
Обновила свой сайт http:/ / iceja. net/ , приделала Fast Fourier Transform экстраполяцию сигналов. Однако предсказывает далеко не каждый сигнал (см ограничения http:/ / iceja. net/ fourier/ docs ). Также. . .
http://iceja.net/ сервер решения полиномов
iceja 18.01.2026
Выкатила http:/ / iceja. net/ сервер решения полиномов (находит действительные корни полиномов методом Штурма). На сайте документация по API, но скажу прямо VPS слабенький и 200 000 полиномов. . .
Расчёт переходных процессов в цепи постоянного тока
igorrr37 16.01.2026
/ * Дана цепь(не выше 3-го порядка) постоянного тока с элементами R, L, C, k(ключ), U, E, J. Программа находит переходные токи и напряжения на элементах схемы классическим методом(1 и 2 з-ны. . .
Восстановить юзерскрипты Greasemonkey из бэкапа браузера
damix 15.01.2026
Если восстановить из бэкапа профиль Firefox после переустановки винды, то список юзерскриптов в Greasemonkey будет пустым. Но восстановить их можно так. Для этого понадобится консольная утилита. . .
Сукцессия микоризы: основная теория в виде двух уравнений.
anaschu 11.01.2026
https:/ / rutube. ru/ video/ 7a537f578d808e67a3c6fd818a44a5c4/
WordPad для Windows 11
Jel 10.01.2026
WordPad для Windows 11 — это приложение, которое восстанавливает классический текстовый редактор WordPad в операционной системе Windows 11. После того как Microsoft исключила WordPad из. . .
Classic Notepad for Windows 11
Jel 10.01.2026
Old Classic Notepad for Windows 11 Приложение для Windows 11, позволяющее пользователям вернуть классическую версию текстового редактора «Блокнот» из Windows 10. Программа предоставляет более. . .
Почему дизайн решает?
Neotwalker 09.01.2026
В современном мире, где конкуренция за внимание потребителя достигла пика, дизайн становится мощным инструментом для успеха бренда. Это не просто красивый внешний вид продукта или сайта — это. . .
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2026, CyberForum.ru