创建一个带有两个 100% 页面宽度的实心条的 960px 样式?
我正在尝试为我正在开发的项目网站创建一个 WordPress 样式。我是一名体验设计师,但有一个概念我想不通。我希望能够将网站的宽度设置为 960px,但顶部有两个栏。你可以在下图中明白我的意思。
https://i.sstatic.net/pSShB.png
我真的希望能够使用蓝色条作为菜单系统,并将所有内容保持在主 960px 整体宽度内。徽标图像需要从内容开头(960px 开始的地方)开始。该图像只是一个模型,但这就是我希望我的用户能够看到它的方式。我希望整个网站能够缩放,以便在任何尺寸的显示器上看起来都一样。
我一整天都在试图想出一个有效的解决方案,但什么也没想到。
有人对我有想法吗?在所有浏览器中都可以使用的东西?
I am trying to create a wordpress style for a project site I am working on. I am an experience designer, but there is a concept that I can't figure out. I'd like to be able to have the width of the site set at 960px, but have two bars at the top. You can see what I mean in the picture below.
https://i.sstatic.net/pSShB.png
I really want to be able to use the blue bar as a menu system and keep all the content within the main 960px overall width. The logo image, needs to start at the very beginning of the content beginning(where the 960px starts). The image is just a mock up, but that's how I want my users to be able to see it. I want the whole site to be able to scale to look the same on any sized monitor.
I have been trying to come up with a solution to do this effectively all day, but haven't managed to think of anything.
Does anyone have an ideas for me? Something that'll work in all browsers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须创建一个相对容器,并在绝对容器内部,如下所示:
您的风格:
基本上,您需要在相对容器 #header_struct 内嵌套绝对定位 div。我没有测试过这个,但我记得做过类似的事情。我希望这能让你开始。
这是一个清理过的 JSFIDDLE 的工作原理:
http://jsfiddle.net/37Fmh/
You would have to create a relative container, and inside of in absolute containers, something like this:
Your Style:
Basically you need nested abosolute positioning divs inside the relative container #header_struct. I haven't tested this, but I recall doing something similar. I hope that gets you started.
Here is a cleaned up JSFIDDLE of it working:
http://jsfiddle.net/37Fmh/
像这样的事情应该可以帮助你开始。
http://jsfiddle.net/pxfunc/DxW47/1/
css:
html:
something like this should get you started.
http://jsfiddle.net/pxfunc/DxW47/1/
css:
html: