Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/83.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 最小化浏览器窗口时,浮动div跳到彼此下方_Html_Css - Fatal编程技术网

Html 最小化浏览器窗口时,浮动div跳到彼此下方

Html 最小化浏览器窗口时,浮动div跳到彼此下方,html,css,Html,Css,我的页眉有三个部分。第一部分是教员徽标,第二部分是网站标题,第三部分是大学徽标 整个标题包含CSS: height: 55px; width:auto; 和背景色 第一组: #header .logoUt { width:285px; height:55px; float:left; background:url(images/Drawing1.png) no-repeat 0 0; background-position:left center; } 第二个div相同

我的页眉有三个部分。第一部分是教员徽标,第二部分是网站标题,第三部分是大学徽标

整个标题包含CSS:

height: 55px;
width:auto; 
和背景色

第一组:

#header .logoUt {
  width:285px;
  height:55px;
  float:left;
  background:url(images/Drawing1.png) no-repeat 0 0;
  background-position:left center; }
第二个div相同:固定宽度、左浮动和文本

第三组:

#header .logoEtti {
  width:285px;
  height:55px;
  float:right;
  background:url(images/Drawing1.png) no-repeat 0 0;
  background-position:left center; }
问题是:当我最小化浏览器窗口时,如何才能使这些div不跳到彼此下面。对不起,我的英语不好


另外,我无法为整个页眉设置固定宽度,因为我希望页眉背景在整个页面中从左到右伸展,高度为55px。

一个选项是不使用浮动,而是定位

试试这个:

给出标题
位置:相对

给出所有3个div内
位置:绝对

使用
top:0;左:第一个div为0

使用
top:0;右:0
表示最后一个


对于中间的一个,为左边给出正确的
px
值:

一个选项是不使用浮动,而是定位

试试这个:

给出标题
位置:相对

给出所有3个div内
位置:绝对

使用
top:0;左:第一个div为0

使用
top:0;右:0
表示最后一个


对于中间的一个,为左侧给出正确的
px
值:

您可以为整个收割台设置
min width

#header {min-width: 855px;}

您可以为整个标题设置
最小宽度

#header {min-width: 855px;}