【问题标题】:Media Query for Page Whose Content Is not Full Width内容不是全宽的页面的媒体查询
【发布时间】:2014-05-22 22:42:08
【问题描述】:

我们正在从我们的一个网站(具有全宽内容)中提取代码,并尝试在另一个网站上使用类似的媒体查询,该网站的内容包括空白侧边栏。主要问题是在移动视图中,我们的页面维护了这些侧边栏并将所有内容压缩成一个瘦列。该页面右侧有一个表单,左侧是图像,上方是徽标,下方是公司徽标,下方是公司徽标。

关于我应该使用哪一部分来填充移动设备的整个宽度有什么建议吗?此外,我们正在 HubSpot 的 COS 中操作这些属性。

这是我们要拉的:

<style>

@media (max-width: 768px) {
.testimonials {margin-top:500px;}
.row-fluid-wrapper.row-depth-3.row-number-3 {background: #FFFFFF;}
}


.inner-form{
margin-left: 68% !important;
max-width: 300px;
margin-top: 20px;
position: relative;
z-index: 2;
}

.outer-form{
height: 345px;
}

.needs-background{
    background: url(http://cdn2.hubspot.net/hub/362750/file-830706138-png/quote_us_medicare/pic.png) no-repeat; padding-bottom:100px;
}
@media(max-width:767px){
  .needs-background{
     background:initial !important;
  }
.inner-form{
margin: 0 auto !important;
height: initial;
margin-top: initial;
}
}
#hs_cos_wrapper_module_1396381482147112 input[type="submit"] {
font-size: 16px !important;
display: inline-block !important;
color: #ffffff !important;
text-align: center !important;
margin-right: 2px !important;
margin-bottom: 15px !important;
margin-top: 15px !important;
padding-right: 35px !important;
margin-left: 2px !important;
padding-bottom: 12px !important;
padding-top: 12px !important;
font-weight: bold !important;
line-height: 30px !important;
border:2px solid;
border-radius:10px;
border-color: #D1D1D1;
}
@media(min-width:768px){
  .small-screen-image{
     display:none !important;
  }
}

</style>

【问题讨论】:

  • 您能提供一个链接以便我们查看 HTML 吗?从外部开始,逐步进入。检查任何边距、填充和宽度值使用相对值,如 Ems 而不是 Px,以便浏览器可以干净地计算比例。另外,为什么你的媒体查询只针对 1px 的宽度(768px)?

标签: html css mobile hubspot


【解决方案1】:

不看 HTML 代码就很难判断。但是根据您的描述,您可以使用移动媒体查询来获取侧边栏并将宽度设置为零并显示:无。然后你可以在同一个查询中设置主窗体的宽度来填充屏幕的宽度。

【讨论】:

  • 这是一个链接,指向现在在 HubSpot 中存在的页面呈现。媒体查询的当前设置是由他们的支持人员为另一个属性完成的,我正在尝试使其适应这个。
  • 对不起,HubSpot 是受密码保护的服务。我们还能以其他方式看待它吗?
  • 试图找出要粘贴的哪一段 html 将保持在字符限制内并具有相关性。
猜你喜欢
  • 2013-01-06
  • 2019-05-08
  • 2018-09-11
  • 2014-10-19
  • 1970-01-01
  • 1970-01-01
  • 2020-04-16
  • 2011-12-17
  • 1970-01-01
相关资源
最近更新 更多