当焦点在文本区域(形式)时,我想要身体,除了那个形式模糊。
React &尾风代码:
<div className="sub-main-container">
<another component/>
<another component/>
<another component/>
<article id="form-message" className="contact-form container mx-auto text-white flex flex-col justify-center items-center m-4">
<h3 className="font-bold text-3xl">Thanks for your visit!</h3>
<form className="bg-white mx-6 w-full flex flex-col mt-2">
<textarea
id="textarea-form-message"
className="p-2 text-black"
placeholder="Let me your message! "
/>
<button className="font-bold text-white bg-[#63b8ea] px-5 rounded-b-sm">
Send me the messagge!
</button>
</form>
</article>
<div>Css代码:
.sub-main-container:focus-within:not(#form-message) {
filter: blur(0.5rem);
}我使用伪类:焦点-内部模糊容器和伪类:not()来避免该表单,但是整个页面都变得模糊了。
知道发生了什么事吗?
发布于 2022-03-29 14:05:57
https://stackoverflow.com/questions/71663490
复制相似问题