防止流体/响应性div浮动

时间:2013-10-20 20:09:07

标签: html navigation responsive-design css-float fluid-layout

过去两周我在这里已经阅读了很多答案,但似乎无法找到解决问题的正确方法。有人能帮忙吗?

我正在尝试构建我的第一个响应式网站,并使用Dreamweaver的流畅模板。但是,我不能阻止我的右下方对齐导航重叠在我的顶部徽标和标语div图层上,并且在手机上查看时无法使我的导航表缩小?

我有一个gridContainer,其中三个800px宽的div在彼此的顶部(这些缩小以适合在较小的门户上查看):
Div id:标题
Div id:logo和
Div id:tag

在此之下,我有三个左侧浮动较窄的div(60%宽)(这些缩小以适合在较小的门户上观察时):
Div id:body
Div id:border和
Div id:bookus

最后,一个导航div(30%宽):
Div id:联系

此导航div是一组翻转图像,其中包含一堆包装箱,其中每个包装箱都是一个链接。因此,我需要将它保留在浏览器窗口的底部,无论它打开多大,而且如果窗口调整为较小,也不要与Logo和Tag div重叠。 (我不能让它在小型门户网站上按比例缩小)

这是我的CSS(道歉,我不确定需要多少信息):

/* Mobile Layout: 480px and below. */

.gridContainer {
margin-left: auto;
margin-right: auto;
width: 84.9333%;
min-height: 600px;
padding-left: 3.0333%;
padding-right: 3.0333%;
padding-top: 3.0333%;
padding-bottom: 0;
top: 10%;
}

#header {
clear: both;
float: left;
margin-left: 0;
margin-top: 15%;
margin-bottom: 10px;
width: 60%;
height: auto;
display: block;

}

#logo {
clear: both;
float: left;
margin-left: 0;
margin-top: 10%;
width: 60%;
height: auto;
display: block;

}

#tag {
clear: both;
float: left;
margin-left: 0;
margin-bottom: 10px;
width: 60%;
height: auto;
display: block;
}

#body {
clear: both;
float: left;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
width: 60%;
display: block;
}

#border {
clear: both;
float: left;
margin-left: 0;
width: 60%;
display: block;
}

#bookus {
clear: both;
float: left;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
width: 60%;
display: block;
}

#contact {
clear: both;
float: right;
margin-right: 0;
margin-top: 10px;
margin-left: 60%;
margin-bottom: 0;
width: 30%;
height: auto;
display: block;
position: absolute;
bottom: 0;
min-height: 158px;
min-width: 132px;
table-layout:auto;
}


/* Tablet Layout: 481px to 768px. Inherits styles from: Mobile Layout. */

@media only screen and (min-width: 481px) {

.gridContainer {
width: 86.8%;
min-height: 800px;
max-height: 100%;
padding-left: 3.1%;
padding-right: 3.1%;
padding-top: 3.1%;
padding-bottom: 0;
top: 10%;
}

#header {
clear: both;
float: left;
margin-left: 0;
margin-top: 15%;
margin-bottom: 10px;
width: 80%;
height: auto;
display: block;

}

#logo {
clear: both;
float: left;
margin-left: 0;
margin-top: 10%;
margin-bottom: 5px;
width: 80%;
height: auto;
display: block;

}

#tag {
clear: both;
float: left;
margin-left: 0;
margin-bottom: 5px;
width: 80%;
height: auto;   
display: block;
}

#body {
clear: both;
float: left;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
width: 60%;
display: block;
}

#border {
clear: both;
float: left;
margin-left: 0;
width: 60%;
display: block;
}

#bookus {
clear: both;
float: left;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
width: 60%;
display: block;
}

#contact {
clear: both;
float: right;
margin-right: 0;
margin-left: 60%;
margin-top: 10px;
margin-bottom: 0;
width: 30%;
display: block;
position: absolute;
bottom: 0;
min-height: 158px;
min-width: 132px;
table-layout:auto;

}

}


/* Desktop Layout: 769px to a max of 1232px.  Inherits styles from: Mobile Layout and Tablet Layout. */

@media only screen and (min-width: 769px) { 

.gridcontainer {
width: 84%;
max-width: 800px;
min-height: 800px;
max-height: 1180px;
padding-left: 3%;
padding-right: 3%;
padding-top: 3%;
padding-bottom: 0;
margin: auto;
top: 10%;
}

#header {
clear: both;
float: left;
margin-left: 0;
margin-top: 15%;
margin-bottom: 10px;
width: 100%;
display: block;

}

#logo {
clear: both;
float: left;
margin-left: 0;
margin-top: 10%;
margin-bottom: 10px;
width: 100%;
height: auto;
display: block;

}

#tag {
clear: both;
float: left;
width: 100%;
height: auto;
margin-left: 0;
margin-bottom: 10px;
display: block;
}

#body {
clear: both;
float: left;
margin-left: 0;
margin-top: 0px;
margin-bottom: 10px;
width: 60%;
display: block;
}

#border {
clear: both;
float: left;
margin-left: 0;
width: 60%;
display: block;
}

#bookus {
clear: both;
float: left;
margin-left: 0;
margin-top: 10px;
margin-bottom: 0px;
width: 60%;
display: block;
}

#contact {
clear: both;
float: right;
margin-right: 30%;
margin-left: 50%;
margin-top: 10px;
margin-bottom: 0;
width: 30%;
height: 30%;
min-height: 158px;
min-width: 132px;
display: block;
position: absolute;
bottom: 0px;
table-layout:auto;
}

}

这是导航表的html源代码,(我需要添加更多吗?):

<div class="contact" id="contact" align="right">
<table width="100%" height="100%"border="0" cellspacing="0" cellpadding="0" style="position:absolute; bottom:0;height:auto; width:auto; max-width:265px; max-height:296px;">
  <tr>
    <td><a href="mailto:email@url.co.uk" target="_blank"><img src="00_assets/buttons/00_BUTTONS_EMAIL.png" alt="email us" name="email" width="265" height="86" id="email" onMouseOver="MM_swapImage('email','','00_assets/buttons/00_BUTTONS_EMAILO.png',1)" onMouseOut="MM_swapImgRestore()" border="0" align="absbottom" style="height:auto; width:auto; max-width:265px; max-height:86px;"></a></td>
  </tr>
  <tr>
    <td><a href="tel:+123-456-7890" target="_blank"><img src="00_assets/buttons/00_BUTTONS_CALL.png" alt="call us" name="call" width="265" height="70" id="call" onMouseOver="MM_swapImage('call','','00_assets/buttons/00_BUTTONS_CALLO.png',1)" onMouseOut="MM_swapImgRestore()" border="0" align="absbottom" style="height:auto; width:auto; max-width:265px; max-height:70px;"></a></td>
  </tr>
  <tr>
    <td><a href="https://www.url.com/" target="_blank"><img src="00_assets/buttons/00_BUTTONS_FB.png" alt="like us" name="fb" width="265" height="70" id="facebook" onMouseOver="MM_swapImage('facebook','','00_assets/buttons/00_BUTTONS_FBO.png',1)" onMouseOut="MM_swapImgRestore()" border="0" align="absbottom" style="height:auto; width:auto; max-width:265px; max-height:70px;"></a></td>
  </tr>
  <tr>
    <td><a href="https://twitter.com/intent/tweet?screen_name=twitterid" target="_blank"><img src="00_assets/buttons/00_BUTTONS_TWEET.png" alt="mention us" name="tweet" width="265" height="70" lowsrc="00_assets/buttons/00_BUTTONS_EMAILO.png" id="tweet" onMouseOver="MM_swapImage('tweet','','00_assets/buttons/00_BUTTONS_TWEETO.png',1)" onMouseOut="MM_swapImgRestore()" border="0" align="absbottom" style="height:auto; width:auto; max-width:265px; max-height:70px;"></a></td>
  </tr>
</table>

非常感谢你,提前。

0 个答案:

没有答案