Вот мой код для моего AppForm.jsx:
Код: Выделить всё
import React, { useState } from 'react'
import DialingCodes from './DialingCodes'
import FileUpload from './FileUpload'
const AppForm = () => {
const [ focused, setFocused ] = React.useState(false)
const handleFocus = (e) => {
setFocused(true)
}
return (
[img]../../../../logo/Logo ROASTAR-white.PNG[/img]
width={150}
/>
Personal Details
First Name must be at least 2 characters or more
Last Name must be at least 2 characters or more
...
...
Код: Выделить всё
.form-content span {
display: none;
}
.form-content input:invalid[data-focused="true"] ~ span {
padding-left: 4.3vw;
text-align: left;
position: relative;
top: 2.7em;
font-size: 12px;
display: block;
color: red;
z-index: 1;
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... all-inputs
Мобильная версия