首页 > 解决方案 > Wordpress CSS 和媒体查询

问题描述

我正在使用 Wordpress 主题并在更改小于 961px 屏幕尺寸的标签/移动视图的@media 查询时面临一些挑战。以下是链接:

http://www.logopexcil.com在更高的分辨率上,标题背景图像从最顶部开始,但低于 961px 的分辨率,它在顶部栏和导航栏之后开始。我尝试使用以下 CSS,但似乎我做错了什么:

@media (max-width: 961px) {
.has-header-type11 .blox.page-title-x,.parallax-sec 
.page-title-x, .has-header-type11 .video-sec .page-title-x {
   top:0!important;  
  }
}

标签: htmlcssmedia-queries

解决方案


根据您的描述,我了解到您需要对齐方面的帮助。这个 CSS 调整容器和标题,因为它们必须颠倒。希望能帮助到你。

@media (max-width: 961px) {
.has-header-type11 .blox.page-title-x,
.parallax-sec 
.page-title-x, 
.has-header-type11 .video-sec .page-title-x {top:0!important;}


  .top-bar {display: none;} /* this was taking up space */
  .container {position:relative;top: 70px;} /* in the HTML this is above header, so bump it down */
  #header.w-header-type-11 {position: relative !important;top: -155px;}
  #main-content.container {padding:0;} /* remove unneeded padding */
}

推荐阅读