js+css实现一个可编辑的有下拉框占位符模仿豆包的ai智能输入框代码

代码语言:html

所属分类:布局界面

代码描述:js+css实现一个可编辑的有下拉框占位符模仿豆包的ai智能输入框代码,可切换不同的模板,模板中包含下拉框、输入框,还可自由编辑删除。

代码标签: js css 可编辑 下拉框 占位符 模仿 豆包 ai 智能 输入框 代码

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

<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI 智能输入框 </title>
    <style>
        :root {
            --primary-blue: #0066ff;
            --bg-gray: #f2f4f7;
            --text-color: #333;
            --chip-bg: #f0f0f0;
            --chip-hover: #e5e5e5;
            --border-radius: 12px;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: #fafafa;
            margin: 0;
        }

        /* 主容器 */
        .input-wrapper {
            background: #fff;
            width: 800px;
            border-radius: 16px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
            padding: 20px;
            position: relative;
            border: 1px solid #eee;
            transition: all 0.2s;
        }

        .input-wrapper:focus-within {
            border-color: var(--primary-blue);
            box-shadow: 0 4px 24px rgba(0, 102, 255, 0.1);
        }

        /* 编辑区域 */
        .editor-box {
            font-size: 16px;
            line-height: 2.4; /* 足够的行高以容纳标签 */
            color: var(--text-color);
            outline: none;
            min-height: 80px;
            margin-bottom: 16px;
            white-space: pre-wrap;
            word-break: break-all;
        }

        /* ================= 标签核心样式 ================= */
        .chip {
            display: inline-flex;
            align-items: center;
 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0