html - 实现页眉,使其元素( Logo 图像)与屏幕尺寸保持一致

标签 html css header

当屏幕尺寸减小时,我正在尝试使页眉中的 Logo 成为脚手架(向下堆叠)。目前我得到以下信息:enter image description here

<div id="header_inner">
<div class="logo"><a rel="home" href=""><img src="/logoShort1.png" alt=""></a></div><!-- .logo -->
<div id="header_extras"><div id="header_extras_inner"><div class="header_social"><div class="social_icon awake_dark"><a href="https://twitter.com/"><img src="twitter.png" alt=""></a></div><div class="social_icon awake_dark"><a href="https://www.facebook.com/pages/1?fref=ts"><img src="http://10.10.1.202//facebook.png" alt=""></a></div><div class="social_icon awake_dark"><a href="mailto:info"><img src="http:///email.png" alt=""></a></div></div></div><!-- #header_extras_inner -->
</div>               
<div id="logoMob" class="headerStack"><img src="/logoMobPhone.png"></div>
<div id="logoLand" class="headerStack"><img src="/logoLandline.png"></div>                
 </div>

最佳答案

我简化了您的 CSS。看起来你想做的太多了。

http://jsfiddle.net/WtZad/1/

CSS

#header_inner {
     min-width: 900px;
     margin: 0 auto;
}
#header_inner > div {
     float: left;
     margin: 5px;  /* add some space around them */
}

使用 width: 900px; 的设置宽度将创建一个水平滚动条。使用 max-width: 990px​​; 允许它在较小的屏幕尺寸下 flex 。

关于html - 实现页眉,使其元素( Logo 图像)与屏幕尺寸保持一致,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17658089/

相关文章:

javascript - 如何使用 node.js 在 html 中调用外部 javascript 文件

javascript - 从单独的 .php 文件执行 &lt;script&gt;

css - 动画运行时禁用过渡

javascript - 最初隐藏一个 div 以供以后显示

css - Chrome和Opera中的CSS错误

android - 如何使用 AddFooterView 使用字符串中的文本添加页脚?

javascript - jQuery 在表单输入中提交 html 以供下载为 html 或 doc 文件

html - 页面内容滚动时静态/固定背景图像?

php - 如何使用HTML和PHP创建一个只有一个提交按钮的多表单搜索功能?

html - 在全屏包装器中垂直居中可变高度 div