如何在 CSS 中将文本和图形重叠在徽标上方?
我有一个在 Photoshop 中保存为 PNG 的徽标,该徽标具有不对称属性:
http: //img291.imageshack.us/img291/1226/examplexh.jpg
该轨迹是徽标的一部分,因此当我保存图像时,它会将其保存为大量图像长方形,路径下方有很多未使用的空间,而人头上方有一些未使用的空间。
问题是,我希望CSS(使用dreamweaver)看起来像我的图像中的模型,但我无法将上面的文本或下面的表格放在我的图像之上。
有解决方法吗?或者我是否需要分别保存人和踪迹并找到解决方法?
这是我目前拥有的 CSS:
{
margin: 0px;
padding: 0px;
}
#wrapper {
height: 1.1in;
width: 100%;
background-color: #0277bc;
position: relative;
}
#wrapper #logo {
position: absolute;
left: 40%;
top: 25%;
}
徽标需要始终稍微偏左,表格始终位于中心,这就是我定义 % 的原因。
谢谢!
I have a logo that I saved as a PNG in photoshop that has asymmetrical properties here:
http://img291.imageshack.us/img291/1226/examplexh.jpg
The trail is a part of the logo, so when I save the image, it saves it as a massive rectangle with a lot of unused space below the trail, and a bit of unused space above the guy's head.
The problem is, I would like the CSS (using dreamweaver) to look like the mockup in my image, but I can't place the text above or the table below overtop of my image.
Is there a workaround to this? Or am I going to need to save the person and the trail separately and find a way around that?
Here is the CSS I currently have:
{
margin: 0px;
padding: 0px;
}
#wrapper {
height: 1.1in;
width: 100%;
background-color: #0277bc;
position: relative;
}
#wrapper #logo {
position: absolute;
left: 40%;
top: 25%;
}
The logo needs to always be slightly left of center with the table always be in the center, that's why I defined %'s.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上,为您的徽标添加绝对位于左上角的
元素很容易。页面的其余部分将显示在其正上方。
如果您希望徽标随页面移动,则需要将 div 居中,为其提供相对位置,居中,并使其固定宽度,有足够的空间容纳表格,两侧的边距可容纳左侧有徽标,右侧有一个空白区域(用于使表格居中)。
It would actually be easy to include an
<img>
element for your logo that is positioned absolute in the top-left corner. The rest of the page would be displayed right over it.If you want the logo to move with your page, you'll need to center a div, give it position relative, center it, and make it fixed width, with enough space to hold the table, and margins on both sides to hold the logo on the left and an empty space (for centering the table) on the right.