Амурный users registration form html. Создание HTML форм. Стилизуем формы, используя CSS3

Here is an example of Registration form using HTML. Here a programmer can display as many "Text Field" as he/she wants. The name in front of Text Field is called "Label". At the end of the registration form their is a "ADD" button behnd which any desired link can be used. Once clicked it will redirect to that particular destination.

Here is an example of Registration form using HTML. Here a programmer can display as many "Text Field" as he/she wants. The name in front of Text Field is called "Label". At the end of the registration form their is a "ADD" button behnd which any desired link can be used. Once clicked it will redirect to that particular destination.

HTML Code for registration form

Here is an example of Registration form using HTML. Here a programmer can display as many "Text Field" as he/she wants. The name in front of Text Field is called "Label". At the end of the registration form their is a "ADD" button behnd which any desired link can be used. Once clicked it will redirect to that particular destination.

In this example we have shown 9 "Text Field". Size of the Text Box can also be changed as per the requirement.

registration.html

registration form

Registration form


Здравствуй, дорогой хабрадруг! В этом туториале мы научимся создавать две формы HTML5: форма входа и форма регистрации. Эти формы будут меняться друг с другом местами с помощью псевдо-класса CSS3 :target . Мы будем использовать CSS3 и шрифт с иконками. Идея этого демо в том, чтобы показать пользователю форму входа и предоставить ему ссылку “перехода” к форме регистрации.
В этом туториале я подробно расскажу о том, как создавать эффект как в Демо 1 .

HTML

Log in

Sign up


Здесь мы использовали несколько приемов HTML5. Например, элемент type=password автоматически скрывает то, что пользователь печатает и заменяет символы точками или звездочками (зависит от браузера). Элемент type=email позволяет браузеру проверить правильность формата email адреса. Кроме того, мы использовали параметр require=required ; браузеры, поддерживающие данный параметр не позволят пользователю отправить форму до тех пор, пока поле не заполнено, JavaScript здесь не требуется. Параметр autocomplete=on будет автоматически заполнять некоторые поля. Мы также использовали замещающийся текст, который поможет пользователю при заполнении формы.

Теперь о двух хитрых моментах. Вы наверное заметили две ссылки в начале формы. Этот ловкий прием позволит нашей формы вести себя правильно при работе с якорями (anchors).

Второй момент связан с применением шрифта с иконками. Мы будем использовать data-attribute , чтобы отобразить иконки. Устанавливая параметр data-icon=”icon_character” с соответствующим символов в HTML, мы должны назначить лишь одно правило в CSS для установления стиля всех иконок. Подробнее об этом приеме можно почитать на сайте: 24 Ways: Displaying Icons with Fonts and Data- Attributes .

CSS

Для чистоты кода я пропущу базовые параметры (html, body и т.п.), но вы сможете найти их в исходных файлах. Повторяю, что я использую приемы CSS3, которые не будут работать во всех браузерах. Итак, давайте же приступим!

Стилизуем формы, используя CSS3

Во-первых, давайте назначим нашим формам базовый стиль.

#subscribe, #login{ position: absolute; top: 0px; width: 88%; padding: 18px 6% 60px 6%; margin: 0 0 35px 0; background: rgb(247, 247, 247); border: 1px solid rgba(147, 184, 189,0.8); box-shadow: 0pt 2px 5px rgba(105, 108, 109, 0.7), 0px 0px 8px 5px rgba(208, 223, 226, 0.4) inset; border-radius: 5px; } #login{ z-index: 22; }

Здесь мы назначим свойства для шапки:

/**** текст ****/ #wrapper h1{ font-size: 48px; color: rgb(6, 106, 117); padding: 2px 0 10px 0; font-family: "FranchiseRegular","Arial Narrow",Arial,sans-serif; font-weight: bold; text-align: center; padding-bottom: 30px; } /** На донный момент только webkit поддерживает background-clip:text; **/ #wrapper h1{ background: -webkit-repeating-linear-gradient(-45deg, rgb(18, 83, 93) , rgb(18, 83, 93) 20px, rgb(64, 111, 118) 20px, rgb(64, 111, 118) 40px, rgb(18, 83, 93) 40px); -webkit-text-fill-color: transparent; -webkit-background-clip: text; } #wrapper h1:after{ content:" "; display:block; width:100%; height:2px; margin-top:10px; background: linear-gradient(left, rgba(147,184,189,0) 0%, rgba(147,184,189,0.8) 20%, rgba(147,184,189,1) 53%, rgba(147,184,189,0.8) 79%, rgba(147,184,189,0) 100%); }

Замечу, что сегодня только браузеры с webkit поддерживают background-clip: text , поэтому мы сделаем полосатый фон только для webkit и привяжем его к заголовку H1. Так как параметр background-clip: text работает только в Webkit браузерах, я решил работать только со свойствами webkit. Именно поэтому я разделил CSS на две части и использовал только градиент webkit. Однако вы не должны использовать лишь webkit на своих вебсайтах! Так, например, параметр -webkit-text-fill-color: transparent позволяет нам иметь прозрачный фон, но только для браузеров webkit, все другие браузеры проигнорируют это свойство.

Мы также создали тонкую линию под заголовком с помощью элемента:after pseudo-class. Мы использовали градиент с 2px в высоту и уменьшили прозрачность по краям до нуля.

Теперь давайте позаботимся о полях ввода и придадим им приятный вид.

/**** advanced input styling ****/ /* placeholder */ ::-webkit-input-placeholder { color: rgb(190, 188, 188); font-style: italic; } input:-moz-placeholder, textarea:-moz-placeholder{ color: rgb(190, 188, 188); font-style: italic; } input { outline: none; }

Во-первых, мы стилизуем поля и уберем обводку. Но будьте осторожны: обводка помогает пользователю понять, на каком поле он находится. Если же вы уберете ее, то нужно применить свойства:active и:focus.

/* все поля исключают submit и checkbox */ #wrapper input:not(){ width: 92%; margin-top: 4px; padding: 10px 5px 10px 32px; border: 1px solid rgb(178, 178, 178); box-sizing: content-box; border-radius: 3px; box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.6) inset; transition: all 0.2s linear; } #wrapper input:not():active, #wrapper input:not():focus{ border: 1px solid rgba(91, 90, 90, 0.7); background: rgba(238, 236, 240, 0.2); box-shadow: 0px 1px 4px 0px rgba(168, 168, 168, 0.9) inset; }

Здесь мы использовали псевдо класс:not, чтобы стилизовать все поля, кроме чекбоксов. Кроме того, я решил убрать обводку и добавил свойства:focus и:active.

Теперь время веселиться: шрифт с иконками. Так как мы не можем использовать псевдо-классы:before и:after, мы добавим иконку в параметр label, а затем разместим в поле. Я буду использовать библиотеку fontomas . Вы можете сами сопоставить иконки с соответствующей буквой. Помните атрибут data-icon ? Именно в него нужно вставить букву. Я использовал data-icon=’u’ для логина, ‘e’ для email, ‘p’ для пароля. Как только я выбрал буквы, я скачал шрифт и использовал генератор шрифтов fontsquirrel для конвертации в формат, пригодный для @font-face.

@font-face { font-family: "FontomasCustomRegular"; src: url("fonts/fontomas-webfont.eot"); src: url("fonts/fontomas-webfont.eot?#iefix") format("embedded-opentype"), url("fonts/fontomas-webfont.woff") format("woff"), url("fonts/fontomas-webfont.ttf") format("truetype"), url("fonts/fontomas-webfont.svg#FontomasCustomRegular") format("svg"); font-weight: normal; font-style: normal; } /** магический трюк! **/ :after { content: attr(data-icon); font-family: "FontomasCustomRegular"; color: rgb(106, 159, 171); position: absolute; left: 10px; top: 35px; width: 30px; }

Вот собственно и все. Вам не требуется иметь отдельный класс для каждой иконки. Мы использовали параметр content: attr(data-icon) , чтобы получить букву из атрибута data-icon. Таким образом, нам нужно лишь назначить шрифт, выбрать цвет и разместить иконку.

Теперь назначим правила для кнопки отправки формы.

/*стилизуем обе кнопки*/ #wrapper p.button input{ width: 30%; cursor: pointer; background: rgb(61, 157, 179); padding: 8px 5px; font-family: "BebasNeueRegular","Arial Narrow",Arial,sans-serif; color: #fff; font-size: 24px; border: 1px solid rgb(28, 108, 122); margin-bottom: 10px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.5); border-radius: 3px; box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.07) inset, 0px 0px 0px 3px rgb(254, 254, 254), 0px 5px 3px 3px rgb(210, 210, 210); transition: all 0.2s linear; } #wrapper p.button input:hover{ background: rgb(74, 179, 198); } #wrapper p.button input:active, #wrapper p.button input:focus{ background: rgb(40, 137, 154); position: relative; top: 1px; border: 1px solid rgb(12, 76, 87); box-shadow: 0px 1px 6px 4px rgba(0, 0, 0, 0.2) inset; } p.login.button, p.signin.button{ text-align: right; margin: 5px 0; }

Трюк заключается в том, чтобы использовать box-shadow, чтобы создать несколько рамок. Естественно, вы можете использовать лишь одну рамку, но также можно и несколько. Мы будем использовать параметр length для создания “фейковой” второй белой рамки, 3px в ширину, без размытия.

Теперь стилизуем чекбокс, здесь мы ничего необычного не сотворим:

/* стилизуем чекбокс "запомнить меня"*/ .keeplogin{ margin-top: -5px; } .keeplogin input, .keeplogin label{ display: inline-block; font-size: 12px; font-style: italic; } .keeplogin input#loginkeeping{ margin-right: 5px; } .keeplogin label{ width: 80%; }

Стилизуем подвал формы, используя множественные линейные градиенты, чтобы создать полосатый градиент.

P.change_link{ position: absolute; color: rgb(127, 124, 124); left: 0px; height: 20px; width: 440px; padding: 17px 30px 20px 30px; font-size: 16px ; text-align: right; border-top: 1px solid rgb(219, 229, 232); border-radius: 0 0 5px 5px; background: rgb(225, 234, 235); background: repeating-linear-gradient(-45deg, rgb(247, 247, 247) , rgb(247, 247, 247) 15px, rgb(225, 234, 235) 15px, rgb(225, 234, 235) 30px, rgb(247, 247, 247) 30px); } #wrapper p.change_link a { display: inline-block; font-weight: bold; background: rgb(247, 248, 241); padding: 2px 6px; color: rgb(29, 162, 193); margin-left: 10px; text-decoration: none; border-radius: 4px; border: 1px solid rgb(203, 213, 214); transition: all 0.4s linear; } #wrapper p.change_link a:hover { color: rgb(57, 191, 215); background: rgb(247, 247, 247); border: 1px solid rgb(74, 179, 198); } #wrapper p.change_link a:active{ position: relative; top: 1px; }

Сейчас вы видите, что у нас две приятные формы, но ведь мы хотим, чтобы отображалась только лишь одна из них. Пришло время анимации!

Создаем анимацию

Первое, что мы сделаем, мы спрячем вторую форму, назначив opacity на 0:

#register{ z-index: 21; opacity: 0; }

Помните, что форма входа имеет параметр z-index: 22? Второй форме мы назначим этот параметр на 21, чтобы поставить его “под” форму входа.

Теперь самое интересное: меняем формы местами, используя псевдо класс:target. Вам нужно понять одну вещь по поводу:target: для перемещения мы будем использовать якоря. Нормальное поведение якоря - прыжок на определенный элемент страницы. Но мы не хотим этого, мы лишь хотим поменять формы местами. И тут приходит на помощь наш трюк с использованием двух ссылок в начале страницы. Вместо того, чтобы направить нас прямо на вторую форму, рискуя испытать эффект “прыжка”, мы придадим ссылкам параметр display: none . Это поможет избежать прыжков. Я обнаружил этот трюк на сайте: CSS3 create (французский язык).

#toregister:target ~ #wrapper #register, #tologin:target ~ #wrapper #login{ z-index: 22; animation-name: fadeInLeft; animation-delay: .1s; }

Вот, что происходит: когда мы кликаем на кнопку Присоединиться , мы направляемся на #toregister. Затем происходит анимация и лишь потом переходим на элемент #register. Мы используем анимацию под названием fadeInLeft . Так как мы “прячем” форму, используя нулевую прозрачность, мы применим анимацию, которая будем постепенно появляться. Мы также изменили z-index, чтобы она появилась поверх другой формы. То же самое происходит для другой формы same happens for the other form.
Вот код для анимации. Мы использовали CSS3 animation framework от Dan Eden и адаптировали этот фреймворк под наш туториал.

Animate{ animation-duration: 0.5s; animation-timing-function: ease; animation-fill-mode: both; } @keyframes fadeInLeft { 0% { opacity: 0; transform: translateX(-20px); } 100% { opacity: 1; transform: translateX(0); } }

Форма, которая “исчезает”, будет иметь анимацию затемнения влево:

#toregister:target ~ #wrapper #login, #tologin:target ~ #wrapper #register{ animation-name: fadeOutLeftBig; } @keyframes fadeOutLeft { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(-20px); } }

Теперь вы можете использовать другие анимации от Dan Eden’ с помощью файла animate.css: просто измените класс.animate class и названия анимаций. Вы также обнаружите несколько других анимаций в конце файла animate-custom.css file.

Вот и все, друзья. Надеюсь вам понравился этот туториал!

Заметим, что в некоторых браузерах параметр background-clip: text не поддерживается. В Internet Explorer 9 анимации не работают. В Internet Explorer 8 и ниже псевдо-класс:target pseudo-class не поддерживается, поэтому там этот эффект вообще работать не будет.

P.S. Все замечания по поводу перевода с удовольствием приму в личку. Спасибо!

Теги: Добавить метки

Login form templates aren’t there just to look beautiful, they need to be simpler and more efficient to fill out. There are many ways to design login forms. But finding the right solution for the job can be a painstaking task. To help you create great looking login page templates quickly, here are some most interesting HTML, CSS techniques that you can easily follow. Just download the template source and test it all by yourself for free!

Free Login/Register Templates

Login & Register Form

Kill two birds with one stone… The form will switch from login to register, and back, based on if the user is already “registered”. Find “registered” users in the js panel.

A simple Login Form template with Flat UI…

Disqus Like Sign-in form

Slick login form with HTML5 & CSS3

A clean and simple login form template with a round submit button and elegant focus states.

Nice and Simple Login Form

A nice and simple HTML/CSS login form template. It uses wordpress’s login system.

CSS3 Login Form Template

An amazing css3 login form template with only html, css features being used. Download and use this as you like.

Flat UI Login Form

Animated Form Switching with jQuery

A simple animated form switch with three very common forms. The idea is not to leave the page when the user goes to another form but instead make the new form appear within the same container, expanding or contracting to the dimensions of the new form.

Slick Login Form With CSS3

A minimal and slick login form template using basic HTML5 and enhancing it with some CSS3 techniques.

Pure CSS Login Form

Simple and effective dropdown login box

In this article, you will learn how to create a good looking dropdown login form template using CSS3 and a bit of jQuery.

Login Form Template with HTML and CSS

Just a simple and flat login form template…

Login

Flat UI Login Form

Custom Login Form Styling

In this tutorial we will create some modern and creative login forms using some interesting CSS techniques and HTML5 goodness.

Login Form with PHP, JQuery and CSS3

Creating an elegant login page using CSS3, Jquery + Ajax and processed by PHP.

Login/Register form with pass metter

Apple-like Login Form with CSS 3D Transforms

In this tutorial we will see how we can use the transforms to create an interesting flipping effect on an Apple-inspired form.

Login Form (Coded)

This freebie is a professional login form. The download includes the PSD file, and xHTML, Js and CSS files as well. You can use it in anyway you want. It involves some nice effects using CSS3 and javascript and I hope you enjoy it!

Login

Login form using HTML5 and CSS3

This is an example how to create a simple login form using HTML5 and CSS3.

DesignMaz have collected list of the best CSS /HTML Login Form Templates for Web Designers, Developers that they can download and use to create a form and most of them also have pre built HTML validation features as well as some option jQuery validation (like the Login /Register form with pass meter below).

Free Responsive Flat Login Form Widget Template

Free Responsive Flat New Login Form Widget Template for your websites. This Login form is designed using web technologies such as . It is completely free for download and can be use for your website or application sign in.

Forms Plus

PopForms

Flat Form with Bootstrap 3

This is a flat modern css3 design based on Booststrap 3 Framework. Responsive design with multi-color multipurpose web forms with pure css3.

Responsive Static Login Form HTML5 Template

Free Responsive Static Login Form HTML5 CSS3 Template. You can download this HTML CSS Sign In Widget which can be used in you web projects.

Free Responsive Flat and Clean Login Form Template

A Responsive Flat and Clean Login Form HTML Template designed using web technologies such as HTML5 and CSS3. You can free download and use for your website or application sign in.

Responsive Flat Purple Login Form Template

A free Responsive Flat Purple Login Form Template built with HTML5, and CSS3. It is completely free for download and can be used straight away in your website or app.

Bootstrap login with social buttons

Any Twitter Bootstrap developer will love these free Responsive Bootstrap login form template with social buttons . This Responsive Bootstrap login form template is a Simple and Clean login form website template base on Bootstrap 3.1.0 .

Easy to use the beautiful and colorful css login form for their own website. Simply insert into the existing CSS file and enjoy the new CSS login form . Created with rounded corners and nice look. It degrades nicely on older browsers, e.g. IE7 and IE8.

MetroLogin is a Windows 8’s Login form simulator that gives you this ability to make a login page for your website’s users or a login Page for your admin panel with a nice metro design.

Twitter Inspired Login Form – Jquery

This is a drop down login form similar to the one found on twitter. It comes complete with JavaScript , CSS and HTML . Just like Twitters login in form it comes with enhancements like tooltips and a compact login form and a clicked state button. It uses CSS3 to reduce the need for images and it degrades nicely in non CSS browsers. It has great browser support and works in most modern browsers and even older ones like Internet explorer 6 and 7.

This is clean and pleasant designed login & register HTML user interface with error handling and social buttons.

Clean and usable login & register form is for every developer. It’s very fast pure CSS . Error handling states, social buttons and forgotten password state is in there.

Zi-Popup Login Forms – Pure CSS3

Clean and usable login & register form is for every developer. It’s very fast CSS form with jQuery validation. Error handling, social buttons and forgotten password handling is in there. Bring to live with a jQuery.

Minimalistic Login/Register Form + Live Validation

Minimalistic Designed Login , Register and Forgot Template Forms Pack. Packed with jQuery Live Validation, 7 color styles, 3 different form size options, title animation, custom checkbox, tooltip hints and jQuery Error Handling.

Summer Forms – Login And Registration Forms

Summer Forms are coupled login and registration forms having a set of impressing effects bundled with the bright modern design. The flexibility of these responsive forms Summer Forms may be become the first brick of your new web site or may be just a replacement of your old forms . Every year the people get more exacting. The forms are well thought out and may satisfy any user.

Not so long ago, in order to achieve such effects, we used JS. But, now, CSS3 has all the necessary tools for making pop-up windows too.

Moon Forms – Login & Registration CSS Forms

Moon Forms are coupled login and registration forms having a modern design. The flexibility of these responsive forms allows placing it into any area on your site (like a widget, like a popup window, like a standalone page).

Tab and form developed by using only CSS3 , no javascript used. It is simple , clean and browser compatible. Very Easy to implement on any kind of website.

Features a large collection of form styles that are used regularly in websites. You get Search Forms , Login Forms , Contact Forms and General Form styles. Further all these forms are available in Dark and Light coloured versions, so you get a total of 224 form styles! The login , contact and general forms also have focus and validation error styles defined in the css.

Form Framework that strikes a balance between simplicity and elegance.CSS3 Responsive Forms kit is simple, clean and fresh modern form pack develop using bootstrap .

Day/Night Login Page

Day / Night Login Forms – has the net and unique design. In the kit you get 2 folder with 6 forms. In two colors white and dark. As in the kit includes 4 style buttons. Thanks to the Day / Night Login Forms developers can save time and money on developing the design. And the designers can see an example of the correct organization of layers.

Is a set of beautiful form elements. It has large amount of customized items, different color schemes, responsive grid system and allows you to create forms of any complexity and for any needs: login , registration , contacts , review , order , comment , checkout , etc.

Nice, clean and easy to use CSS3 login panel which 3 included color schemes.

Golden Forms – Responsive CSS3 Form Framework

Golden Forms is a simple and professional Form Framework that strikes a balance between simplicity and elegance. The framework is built with pure CSS3 + HTML5 (no images), features a clean consistent Form UI , responsive 12 column grid, and can be used to build any kind of Web Forms quickly whether simple or complex, without special CSS and coding knowledge.

– has a clean design and a powerfull 3D Flip Effect which give user a unique exprince and a fast way to complete the process . In the kit you get 1 psd file with 3 forms styes.

Responsive HTML5 – jQuery Sign In – Registration Form

Responsive HTML5 Sign In / Registration form , with jQuery effects and CSS3 customization.

Для обмена данными между компьютером пользователя и сервером в HTML применяются формы . Обычно обмен данными происходит следующим образом: пользователь вводит требуемые данные в поля формы, после чего они отправляются на сервер, где обрабатываются соответствующей программой. Если это, например, регистрационные данные пользователя, то они проверяются на соответствие предъявляемым требованиям и, в случае успешной проверки, заносятся в базу данных. Пользователю при этом возвращается ответ, в котором либо сообщается об успешном завершении регистрации, либо предлагается возможность исправить ошибки, допущенные в ходе заполнения полей формы. Конечно, применение форм не ограничивается только лишь сбором данных от пользователей и передачей их на сервер для обработки, однако данное предназначение следует считать основным.

Тег
и его атрибуты

Формируется элемент "form" при помощи парного тега и представляет собой контейнер, в котором расположены элементы формы: поля ввода, кнопки и т.д., которые мы подробно рассмотрим в следующих пунктах. Сейчас же перечислим атрибуты элемента "form" .

  • name - определяет уникальное имя формы, которое в основном используется для доступа к ней через скрипты.
  • action - в качестве значения принимает полный или относительный путь к серверной программе-обработчику, которой будут передаваться данные формы после отправки на сервер.
  • target - принимает в качестве значения имя окна или фрейма, в который будет загружаться html -страница, возвращаемая серверной программой-обработчиком после обработки пользовательских данных. Напомним, что в качестве зарезервированных имен атрибут target может принимать ряд значений, которые уже перечислялись ранее .
  • enctype - устанавливает способ кодирования отправляемых данных. Может принимать значения:
    • "application/x-www-form-urlencoded" - применяется по умолчанию и подходит для большинства случаев, поэтому сам атрибут enctype обычно не указывается;
    • "multipart/form-data" - следует использовать при отправке файлов;
    • "text/plain" - кодирует данные в виде простого текста, только заменяя пробелы знаком "+" ; требуется редко, например, может быть полезен при отправке данных формы по электронной почте.
  • novalidate - отменяет встроенную проверку данных вводимых пользователем в поля формы на ошибки. Значений не принимает и по умолчанию выключен.
  • autocomplete - позволяет отключать автозаполнение полей формы, которое происходит при повторном вводе одинаковых данных. Принимает два значения "on" (по умолчанию) и "off" . При этом, если автозаполнение отключено в настройках самого браузера, то данный атрибут игнорируется. Кроме того, значение атрибута может быть переопределено таким же атрибутом autocomplete , но у конкретных элементов формы, например, в случае необходимости не сохранять важные данные вроде паролей, номеров банковских карт и т.д.
  • accept-charset - указывает кодировку символов передаваемых данных, например, "utf-8" . Если атрибут не указан, то указывается кодировка, установленная для страницы.
  • method - принимает значения "GET" или "POST" , которые определяют метод отправки данных формы на сервер. По умолчанию применяется "GET" .

Чтобы иметь визуальное представление о форме, давайте посмотрим на пример 6.1.

Формы



Пример 6.1. Использование элемента "form"