帖子
帖子
用户
博客
课程
显示全部楼层
13
帖子
0
勋章
204
Y币

[问题求助] 这个情况该怎么解决

[复制链接]
发表于 2022-9-13 11:52:09
这个怎么办?怎么能在搜索的时候让文字一直在搜索框下面,不然搜索框一直在文字中间太难受了。第一个图是搜索之前,第二图是搜索之后。
111.jpg 2222.jpg

380
帖子
4
勋章
6
Y币
设置css样式,显示区域往下定位
13
帖子
0
勋章
204
Y币
老大,是这个函数:overflow: hidden?
技术咨询-F · 2022-9-13 12:05设置css样式,显示区域往下定位
380
帖子
4
勋章
6
Y币
  1. https://www**.**.cn/css/css_positioning_relative.asp
复制代码
丑萌的小白 · 2022-9-13 12:48老大,是这个函数:overflow: hidden?
13
帖子
0
勋章
204
Y币
老大,我这么写不对吗?为什么搜索时文字又跑到最上面去了。帮忙指点一下吧。

</head>
<body>
//搜索按钮样式
    <div style="position: fixed; right: 20px; top: 0;">
        <p>
         <p>
         <p>
        <input id="key" type="text" style=" 100px;" size="30"/>
        <input type="button" value="下一个" />
        <input type="button" value="上一个" />
    </div>
//设置相对位置及内容
</body>
<style type="text/css">
<style>
        p#p1
        {
        position:relative;
        top: 30px;
        }
        </style>
    <body>
        <p id="p1"><h1 style="margin: 0px; padding: 10px; border: 0px; font: bold 24px / 38.4px &quot;Microsoft yahei&quot;; vertical-align: baseline; text-align: center; color: rgb(33, 83, 173);">
                 </h1>
        <h1 style="margin: 0px; padding: 10px; border: 0px; font: bold 24px / 38.4px &quot;Microsoft yahei&quot;; vertical-align: baseline; text-align: center; color: rgb(33, 83, 173);">
                 </h1>
        <h1 style="margin: 0px; padding: 10px; border: 0px; font: bold 24px / 38.4px &quot;Microsoft yahei&quot;; vertical-align: baseline; text-align: center; color: rgb(33, 83, 173);">
                xxxxxxx</h1>
                <h2 style="margin: 0px; padding: 8px 0px; border: 0px; font: bold 20px / 1.5 楷体; vertical-align: baseline; text-align: center; color: rgb(33, 83, 173);">
                (xxxxxxx,2017年10月24日通过)</h2>               
                <div id="content">
                        <p style="margin: 0px; padding: 6px 0px; border: 0px; font: 17px / 34px &quot;Microsoft yahei&quot;; vertical-align: baseline; text-indent: 2em; text-align: center;">
                        <strong>总 纲</strong></p>
                        <p style="margin: 0px; padding: 6px 0px; border: 0px; font: 17px / 34px &quot;Microsoft yahei&quot;; vertical-align: baseline; text-indent: 2em;">
                        xxxxxxx,同时xxxxxxx,是中xxxxxxx,代xxxxxxx求,代表xxxxxxx向,代xxxxxxx利益。xxxxxxx义。</p>
</p>
</body>

380
帖子
4
勋章
6
Y币
<div style="position: absolute; right: 20px; top: 0;">

380
帖子
4
勋章
6
Y币
多看看css 官网教程,把相对定位,绝对定位学明白。
13
帖子
0
勋章
204
Y币
在搜索上加了个box,然后在js里重新写了数据就好了。谢谢老大。
技术咨询-F · 2022-9-14 13:53多看看css 官网教程,把相对定位,绝对定位学明白。
您需要登录后才可以回帖 登录

本版积分规则