在wordpress上定义视口时,页脚会搞乱

问题描述 投票:0回答:1

尝试使你的wordpress主题响应,从添加开始

<meta name="viewport" content="width=device-width, initial-scale=1" />

在标题的head标签内,它对页脚有这种影响......

有什么方法可以解决这个问题?先感谢您

wordpress responsive-design viewport
1个回答
1
投票

您无法使站点响应将视口添加到其中。

尝试使用媒体查询:

https://www.w3schools.com/css/css_rwd_mediaqueries.asp

你可以使用bootstrap等框架:

https://getbootstrap.com/

您现在可以将此代码添加到其他CSS中

@media only screen and (max-width: 768px) {
#footer {
  float: left;
  background: url(images/footer.jpg) 50% 0;
  width: 100%;
  height: auto;
  display: flex;
  flex-direction: column;
}
#footer p {
  float: left;
  width: 100%;
  margin: 40px 0 0 0;
  text-align: center;
  color: #b5b5b5;
  font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
  font-size: 12px;
  line-height: 18px;
}
}
© www.soinside.com 2019 - 2024. All rights reserved.