简体   繁体   English

服务器更改后CSS发生的奇怪事情

[英]Weird things happening with CSS after server change

So I had my "My Work" page laid out exactly the way I wanted it yesterday, and I needed to change servers. 因此,我的“我的工作”页面的布局完全符合我昨天想要的方式,因此我需要更换服务器。 I changed servers, and all my other sites are fine, but the look of my "My Work" page got messed up. 我更换了服务器,所有其他站点都正常,但是“我的工作”页面的外观混乱了。 Basically the background image from the bottom widget area is now in the middle of the page. 基本上,底部小部件区域的背景图像现在位于页面中间。 It looks like nothing on this page is inside of its container anymore. 看起来此页面上的任何内容都不再位于其容器中。 It definitely was before I changed servers. 肯定是在我更换服务器之前。

Any help would be greatly appreciated, I've no idea why it's only affecting this one page on this one site. 任何帮助将不胜感激,我不知道为什么它只影响此站点上的这一页面。 I tried re-uploading the css file, and the entire theme to the new server and nothing changed. 我尝试将css文件重新上传,并将整个主题重新上传到新服务器,并且没有任何更改。

Edit: Sorry, here is the css for the widget area that's floating in the middle of the page: 编辑:很抱歉,这是浮动在页面中间的小部件区域的CSS:

.widget-area {
  padding-top: 40px;
  font-family: 'Alegreya Sans', sans-serif;
  font-size: 20px;
  color:#d2c1ad;
  margin-top: 3%;
  background-image:url(images/widgetarea.png);
  background-repeat:no-repeat;
  background-size: 101%;
}

EDIT: Floated items do not take up any space. 编辑:浮动项目不占用任何空间。 So even though you have a bunch of .gallery-item divs in there, they are not making the container have a height since they're floated. 因此,即使您在那里有一堆.gallery-item div,它们也不会使容器具有高度,因为它们是浮动的。 You need to clear the float. 您需要清除浮动。 The easiest way is to add a div after the last .gallery-item. 最简单的方法是在最后一个.gallery-item之后添加一个div。 Give it the css of clear:both; 给它css的clear:both;

On line 555 of your stylesheet where you have .widget-area, add: 在样式表的第555行中,您拥有.widget-area,添加:

 background-position: bottom center; 

The problem is the margin-top on your aside objects in the widget. 问题是小部件中aside在对象上的页margin-top To prove this, change the margin-top to a smaller value for your .widget class. 为了证明这一点,请将.widget类的margin-top更改为较小的值。 For me, this moved the black wiggly thingy to the bottom, just above the footer, and the three aside elements were to the right, all above or below each other. 对我来说,这使黑色的摇摆物移动到底部,位于页脚上方,而三个aside元素位于右侧,彼此上下。

I'm guessing there is a better way to make this work, and I personally would stay away with using percentages. 我猜想有一种更好的方法可以完成这项工作,我个人会避免使用百分比。 But I'm in no way a css expert and there are plenty of those on here that might give you a better, more robust solution to your problem. 但是我绝不是CSS专家,这里有很多可以为您提供更好,更可靠的解决方案的专家。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM