简体   繁体   English

向下移动页面以允许标题图形

[英]Move page down to allow header graphic

I am working with a program that allows me to add content, within a cell, in a table. 我正在使用一个程序,该程序允许我在表格的单元格内添加内容。 All types of content is allowed, however, so I have added a reference to a stylesheet that is allowing me to re-brad the application. 但是,所有类型的内容都是允许的,因此我添加了对样式表的引用,这使我可以重新编写应用程序。

The application is accessed via web browser inside our organization using mostly IE8 and IE10, as well as the application interface which use IE7 mode. 可通过我们组织内部的Web浏览器(主要使用IE8和IE10)以及使用IE7模式的应用程序界面来访问该应用程序。 Therefore, it has to be compatible with all of those browser modes at various screen resolutions. 因此,它必须与各种屏幕分辨率的所有这些浏览器模式兼容。

What I am trying to accomplish is adding a header graphic, to a page that never had one. 我要完成的工作是向从未有过的页面添加页眉图形。 The layout is as such 布局就是这样

<table width="60%">
    <tbody>
        <tr>
            <td>
                Here is my content
            </td>
        </tr>
    </tbody>
</table>
Rest of page content here

I want a header image to cover the top part of the browser, so I have inserted an image 我希望标题图片覆盖浏览器的顶部,所以我插入了图片

In the HTML I get to input 在HTML中,我可以输入

<img src="/pathtoimage.png" class="newhead">

CSS CSS

.newhead
{
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -100;
}

Since the graphic is removed from the document flow, the rest of the page content wants to start behind the graphic. 由于图形已从文档流中删除,因此其余页面内容希望从图形后面开始。

Since the graphic will change heights, depending on browser size (adjusting proportionately on width), the content needs to move down by that same amount. 由于图形会根据浏览器大小(根据宽度进行相应调整)改变高度,因此内容需要向下移动相同的数量。

Any advice is appreciated on how to best accomplish this. 感谢您提供任何有关如何最好地完成此操作的建议。 I have been racking my brain at how to do this, and have it work with IE7 mode (I know, I know) 我一直在思考如何执行此操作,并使其在IE7模式下工作(我知道,我知道)

What I have been attempting is to use a transparent image that is 60% width of the header graphic (same height) - that way it would resize proportionately along with the header graphic) but getting it to properly fill the table, or stay 60%, or do anything according to plan has proven to not work. 我一直在尝试使用透明图像,它是标题图形宽度的60%(相同高度)-这样,它将与标题图形一起按比例调整大小),但要使其正确填充表格或保持60% ,或按计划做任何事情都被证明是行不通的。

Again, thank you for any help 再次感谢您的帮助

Why make the position absolute? 为什么要使位置绝对? You can change the side of the header and have it push down as to whatever size you'd like it to be. 您可以更改页眉的侧面,并将其向下推至所需大小。

.newhead
{
    width: 100%;
    display: block;
}

and in case you want to get rid of the default padding: 并且如果您想摆脱默认的填充:

body
{
    margin: 0;
    padding: 0;
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM