[HTML+CSS+JS] 实现注册登录页面,2024大厂前端面试题精选

本文作者为阿里P7,分享了《2024年最新Web前端全套学习资料》,包括大厂面经、学习笔记等,旨在帮助开发者系统学习前端知识。文章通过实例演示了如何使用HTML、CSS和JavaScript实现注册登录页面的样式和交互,并提供了获取完整资料的方式。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

先自我介绍一下,小编浙江大学毕业,去过华为、字节跳动等大厂,目前阿里P7

深知大多数程序员,想要提升技能,往往是自己摸索成长,但自己不成体系的自学效果低效又漫长,而且极易碰到天花板技术停滞不前!

因此收集整理了一份《2024年最新Web前端全套学习资料》,初衷也很简单,就是希望能够帮助到想自学提升又不知道该从何学起的朋友。
img
img
img
img
img
img

既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上前端开发知识点,真正体系化!

由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、讲解视频,并且后续会持续更新

如果你需要这些资料,可以添加V获取:vip1024c (备注前端)
img

正文

.card .right {

flex: 1;

position: relative;

text-align: center;

font-size: 0.44rem;

width: 6rem;

height: 6rem;

background-color: #bde5fc;

}

.card .right img {

position: absolute;

top: 0.5rem;

left: -0.3rem;

width: 110%;

}

.card .right .right-1 {

margin-top: 0.24rem;

letter-spacing: 0.04rem;

color: #013356;

}

.card .right .right-2 {

font-size: 0.48rem;

letter-spacing: 0.02rem;

color: #013356;

}

.card .right .right-3 {

position: absolute;

top: 4.45rem;

font-size: 0.28rem;

color: #013356;

left: 50%;

width: 4rem;

transform: translateX(-50%);

}

.card .right .right-btn {

position: absolute;

top: 5rem;

left: 50%;

transform: translateX(-50%);

width: 2rem;

height: 0.6rem;

color: #013356;

background-color: #fff;

border: 1px solid #013356;

font-size: 0.28rem;

border-radius: 0.28rem;

}

.box {

position: absolute;

text-align: center;

top: -0.75rem;

left: 7.5rem;

width: 5.5rem;

height: 7.5rem;

background-color: #fff;

color: #7921a1;

border: 2px solid #7921a1;

box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.4);

z-index: 999;

}

.box p {

font-size: 0.68rem;

font-weight: 700;

margin-top: 1.2rem;

}

.box input {

position: absolute;

left: 50%;

transform: translateX(-50%);

font-size: 0.28rem;

text-decoration: solid;

color: #7921a1;

border-bottom: 1px solid #7921a1;

}

.box .box-1 {

top: 2.7rem;

}

.box .box-2 {

top: 3.7rem;

}

.box button {

position: absolute;

transition: all 0.5s;

top: 5rem;

left: 50%;

transform: translateX(-50%);

width: 3.6rem;

height: 0.7rem;

font-size: 0.28rem;

border: 1px solid #fff;

color: #fff;

border-radius: 0.2rem;

font-weight: 500;

background-color: #7921a1;

}

index.js:

var leftbtn = document.querySelector(‘.left-btn’);

var rightbtn = document.querySelector(‘.right-btn’);

var box = document.querySelector(‘.box’);

var width = box.offsetWidth;

leftbtn.addEventListener(‘click’,function() {

var translatex = -width;

box.style.transition = ‘all .5s’

box.style.transform = ‘translateX(’ + translatex + ‘px)’

box.children[0].innerHTML = ‘REGISTER’;

box.style.border = ‘1px solid #013356’;

box.style.color = ‘#013356’;

box.children[1].style.borderBottom = ‘1px solid #013356’;

box.children[2].style.borderBottom = ‘1px solid #013356’;

box.children[3].style.backgroundColor = ‘#013356’;

box.children[1].style.color = ‘#013356’;

box.children[2].style.color = ‘#013356’;

box.children[3].innerHTML = ‘注册’;

var input = document.createElement(‘input’);

box.appendChild(input);

box.children[4].value = ‘确认密码’;

box.children[4].style.color = ‘#013356’;

box.children[4].style.borderBottom = ‘1px solid #013356’;

box.children[4].style.top = ‘4.7rem’;

box.children[3].style.top = ‘5.7rem’;

})

rightbtn.addEventListener(‘click’,function() {

box.style.transition = ‘all .5s’

box.style.transform = ‘translateX(’ + 0 + ‘px)’

box.children[0].innerHTML = ‘LOGIN’;

box.style.border = ‘1px solid rgb(121, 33, 161)’;

box.style.color = ‘rgb(121, 33, 161)’;

box.children[1].style.borderBottom = ‘1px solid rgb(121, 33, 161)’;

box.children[2].style.borderBottom = ‘1px solid rgb(121, 33, 161)’;

box.children[3].style.backgroundColor = ‘rgb(121, 33, 161)’;

box.children[1].style.color = ‘rgb(121, 33, 161)’;

box.children[2].style.color = ‘rgb(121, 33, 161)’;

box.children[3].innerHTML = ‘登录’;

box.removeChild(box.children[4]);

box.children[3].style.top = ‘5rem’;

box.children[3].style.color = ‘#fff’;

})

normalize.css:

这个就是css的初始化文件

html {

line-height : 1.15;

/* 1 */

-webkit-text-size-adjust: 100%;

/* 2 */

}

body {

margin: 0;

}

main {

display: block;

}

h1 {

font-size: 2em;

margin : 0.67em 0;

}

hr {

box-sizing: content-box;

/* 1 */

height : 0;

/* 1 */

overflow : visible;

/* 2 */

}

pre {

font-family: monospace, monospace;

/* 1 */

font-size : 1em;

/* 2 */

}

a {

background-color: transparent;

}

abbr[title] {

border-bottom : none;

/* 1 */

text-decoration: underline;

/* 2 */

text-decoration: underline dotted;

/* 2 */

}

b,

strong {

font-weight: bolder;

}

code,

kbd,

samp {

font-family: monospace, monospace;

/* 1 */

font-size : 1em;

/* 2 */

}

small {

font-size: 80%;

}

sub,

sup {

font-size : 75%;

line-height : 0;

position : relative;

vertical-align: baseline;

}

sub {

bottom: -0.25em;

}

sup {

top: -0.5em;

}

img {

border-style: none;

}

button,

input,

optgroup,

select,

textarea {

font-family: inherit;

/* 1 */

font-size : 100%;

/* 1 */

line-height: 1.15;

/* 1 */

margin : 0;

/* 2 */

}

button,

input {

/* 1 */

overflow: visible;

}

button,

select {

/* 1 */

text-transform: none;

}

button,

type=“button”,

type=“reset”,

[type=“submit”] {

-webkit-appearance: button;

}

button::-moz-focus-inner,

[type=“submit”]::-moz-focus-inner {

border-style: none;

padding : 0;

}

button:-moz-focusring,

[type=“submit”]:-moz-focusring {

outline: 1px dotted ButtonText;

}

fieldset {

padding: 0.35em 0.75em 0.625em;

}

legend {

box-sizing : border-box;

/* 1 */

color : inherit;

/* 2 */

display : table;

/* 1 */

max-width : 100%;

/* 1 */

padding : 0;

/* 3 */

white-space: normal;

/* 1 */

}

progress {

vertical-align: baseline;

}

textarea {

overflow: auto;

}

[type=“checkbox”],

[type=“radio”] {

box-sizing: border-box;

/* 1 */

padding : 0;

/* 2 */

}

type=“number”::-webkit-outer-spin-button {

height: auto;

}

[type=“search”] {

-webkit-appearance: textfield;

/* 1 */

outline-offset : -2px;

/* 2 */

}

[type=“search”]::-webkit-search-decoration {

-webkit-appearance: none;

}

::-webkit-file-upload-button {

-webkit-appearance: button;

/* 1 */

font : inherit;

总结

根据路线图上的重点去进行有针对性的学习,在学习过程中,学会写笔记,做总结。

这里分享一些前端学习笔记:

  • html5 / css3 学习笔记

  • JavaScript 学习笔记

  • Vue 学习笔记

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注前端)
img

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
inherit;

总结

根据路线图上的重点去进行有针对性的学习,在学习过程中,学会写笔记,做总结。

这里分享一些前端学习笔记:

  • html5 / css3 学习笔记

  • JavaScript 学习笔记

  • Vue 学习笔记

网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。

需要这份系统化的资料的朋友,可以添加V获取:vip1024c (备注前端)
[外链图片转存中…(img-4QjgGPnB-1713205627524)]

一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值