Html 按右定位iframe显示的文本

Html 按右定位iframe显示的文本,html,css,iframe,Html,Css,Iframe,我想做一个索引(iframe)的一页,但我不能做在前面的文字。文本位于iframe后面,或者iframe不在右角,无论我如何尝试 page.html <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="

我想做一个索引(iframe)的一页,但我不能做在前面的文字。文本位于iframe后面,或者iframe不在右角,无论我如何尝试

page.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>

<body>


    <iframe src="index.html" height="520" style="right: 10px; position:fixed">
    </iframe>


some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text -- some text

</body>
</html>

页
一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本--一些文本
index.html

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>index</title>
    <style type="text/css">
        <!--
            BODY {
            COLOR: #0080FF;
            BACKGROUND: black;
        -->
    </style>
</head>
<body>

some text  </br>

some text  </br>

some text  </br>

</body>
</html>

指数
一些文本
一些文本
一些文本

我希望在滚动时,文本在iframe的一侧不在后面,而在文本的右侧浮动iframe,以便始终可见。ifame不应像页面上的其他文本那样上下移动。或者有没有更好的方法,而不是使用iframe?

您可以通过一些简单的浮动来实现这一点。我会移动你的CSS样式。这是一个简单的例子,你可以用你想要的任何东西来填充剩下的部分

//style.css
.集装箱{
宽度:100%;
高度:自动;
}
.一些文字{
浮动:左;
宽度:250px;//可以随意更改
}
iframe{
位置:固定;
浮动:对;
高度:120px;
宽度:250px;//可以随意更改
}

一些标题
一些文字,一些文字,一些文字


向下滚动,您将看到iframe保持在原来的位置。这是一个

.wrapper{
宽度:100%;
高度:自动;
}
.maintext{
浮动:对;
宽度:计算(100%-320px);
}
iframe{
位置:固定;
浮动:左;
顶部:10px;
高度:300px;
宽度:300px;
}

标题
滚动,您将看到iframe保持不变。Lorem ipsum dolor sit amet,Concertetur Adipsicing Elite。这是一个自由的时刻,利奥·佩伦茨克的座右铭。这是一个无名小卒,一个有尊严的人,一个无名小卒。维韦拉庄园的自由女神。罗丹明原。Mauris sed justo前庭,ultricies risus nec,ullamcorper erat。怀孕期间的佩伦茨克,nec feugiat dui。普罗纳·努克、马蒂斯·欧佩伦茨克·尤里西斯、阿库姆桑·维勒·杜伊。
请不要坐在那里。大菱鲆(Vivamus rhoncus egestas convallis)。红毛癣菌和直径癣菌。艾蒂安·布兰迪特·奥古斯·奎斯·帕特·卢克图斯。苏打菜。乌兰姆科珀的佩伦茨克·维塔·阿库。酒后驾车,静脉曲张,妊娠性骚扰。莫里斯·塞德·托托·尼西。
奥奇设施,福西布斯·梅特斯等,乌拉姆科珀·泰勒斯。在faucibus中,Interdum和malesuada在第一次同侧前就出名了。我们要活得好好的,要活得有效率。在自然社会中,因怀孕而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯,因饥饿而死亡的蒙特斯。埃利弗德·奥迪奥·埃吉特·埃利弗德·洛博蒂斯万岁。Morbi和ante scelerisque erat sagittis dictum。这是一个很好的例子。这是一份苏打水。整型前交叉韧带。巨大的侵权者。奥奇乌尔特里斯修道院、艾米特修道院、帕特莫里斯修道院。乌贼乌贼。克拉斯·维塔·亨德雷特·奎姆。奥古斯·瓦里乌斯(augue varius)的梅塞纳斯(Maecenas)、萨皮安·乌特(scelerisque sapien ut)、苏西比特·内克(suscipit neque)


我认为这个答案中的左和右是错误的。它们应该被切换。如何在index.html中创建一个链接以跳转到page.html的一部分而不加载整个页面。是否要在iframe@andrej中加载该链接?不,在page.html中。我想我找到了。我将在index.html中添加
target=“\u parent”