css实现自适应简洁英文登录注册表单页面代码

代码语言:html

所属分类:表单美化

代码描述:css实现自适应简洁英文登录注册表单页面代码

代码标签: css 自适应 简洁 英文 登录 注册 表单 页面 代码

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
<style>
    :root {
    --primary: #2B805A;
    --primary-light: #6EE7B7;
    --primary-disabled: #90BCA9;
    --primary-lighter: #A4C8B9;
    --secondary: #1D1D1D;
    --text: #11181C;
    --text-gray: #687076;
    --text-placeholder: #8890A7;
    --border: #DFE3E6;
    --btn-bg: #EDEDED;
    --input-bg: #F1F2F3;
    --main-side-background: #F8F9FA;
    --error: #e5484d;
}

body {
    font-size: 16px;
    font-family: Circular, Helvetica Neue,
        Helvetica, Arial, sans-serif;
    font-feature-settings: normal;
    font-variation-settings: normal;
    height: 100vh;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::selection {
    background-color: var(--primary-light);
}

.socials-row {
    display: flex;
}

.socials-row img {
    width: 1.5rem;
    height: 1.5rem;
}

.socials-row>a {
    padding: 0.5rem;
    border-radius: 0.5rem;
    width: 100%;
    min-height: 2.75rem;
    display: flex;
    gap: 0.75rem;
    color: var(--text);
    justify-content: center;
    align-items: center;
    text-decoration: none;
    font-size: 1.1rem;
    color: var(--text);
    padding: 0.5rem;
    border: 1px solid var(--border);
    transition: all .3s ease;
    box-shadow: rgba(99, 99, 99, 0.2) 0px 1px 4px 0px;
}

.socials-row>a svg {
    color: var(--text)
}

.socials-row>a:hover {
    background-color: var(--btn-bg);
}

.form-welcome-row {
    margin-bottom: 1rem;
}

.form-welcome-row h1 {
    color: var(--text);
    font-size: 2rem;
    line-height: 2rem;
    font-weight: normal;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
}

.form-welcome-row h2 {
    color: var(--text-gray);
    font-size: 1.10rem;
    font-weight: normal;
}

.divider {
    display: flex;
    flex-direction: row;
    color: var(--secondary);
    gap: 1rem;
    align-items: center;
}

.divider-line {
    width: 100%;
    height: 1px;
    background-color: var(--secondary);
    opacity: .2;
}

.form-wrapper {
    position: relative;
    display: grid;
    grid-template-columns: 6fr 5fr;
    margin: 0 auto;
    height: 100%;
}

.form-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 2rem;
    background-color: var(--main-side-background);
    box-shadow: rgba(99, 99, 99, 0.10) 3px 2px 2px -1px;
}

.logo {
    height: 1.5rem;
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
}

.my-form {
    display: flex;
    flex-direction: column;
    justify-content: start;
    position: relative;
    gap: 1.25rem;
    max-width: 23rem;
    width: 100%;
}

.my-form__button {
    background-color: var(--primary);
    border: 1px solid var(--primary-light);
    color: white;
    white-space: nowrap;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    line-height: 2.75rem;
    outline: none;
    font-size: 1.125rem;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    border-radius: 0.5rem;
    box-shadow: 0 5px 10px rgba(0, 0, 0, .15);
    transition: all .3s ease;
}

.my-form:invalid .my-form__button {
    pointer-events: none;
    background-color: var(--primary-disabled);
    border: 1px solid var(--primary-light);
}

.my-form__actions {
    display: flex;
    flex-direction: column;
    color: var(--secondary);
    gap: 1rem;
    margin-top: 0.5rem;
}

.my-form__actions a {
    color: var(--text);
}

.my-form__actions a:hover {
    color: var(--text-gray);
    text-decoration: underline;
}

.my-form__row {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.text-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.text-field input {
    color: var(--secondary);
    max-width: 100%;
    width: 100%;
    border: 1px solid var(--border);
    min-height: 2.75rem;
    letter-spacing: .03rem;
    outline: none;
    background-color: var(--input-bg);
    transition: .25s;
    border-radius: 0.5rem;
    text-indent: 1.25rem;
}

.text-field label {
    color: var(--text-gray);
}


.text-field input:user-invalid {
    background-color: var(--white);
    color: var(--error);
    border: 1px solid var(--error);
}

.error-message {
    display: none;
}

.text-field input:user-invalid~.error-message {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--error);
}

.text-field input:focus {
    border: 1px solid var(--text);
    box-shadow: rgba(99, 99, 99, 0.2) 0px 1px 4px 0px;
}

/* aside */
.info-side {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 3rem;
}

.info-side .blockquote-wrapper {
    gap: 1rem;
    position: relative;
}

.info-side .blockquote-wrapper blockquote {
    margin-bottom: 1rem;
    max-width: 30rem;
    width: 100%;
    font-size: 1.25rem;
    line-height: 2.25rem;
}

.info-side .blockquote-wrapper blockquote::before {
    content: open-quote;
    font-size: 4rem;
    li.........完整代码请登录后点击上方下载按钮下载查看

网友评论0