css背景图像被装箱成白色不是全角 [英] css Background image to be boxed white not fullwidth

查看:127
本文介绍了css背景图像被装箱成白色不是全角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

上帝另一个关于css测试网站的问题是 http://testpress.dramend.com/修改-2 / ,我目前有这个主要内容作为一个白色背景的全宽:


但我想实现的是这种带有相同白色背景的盒装布局,但是它需要像这个样本盒装:



我使用wordpress优化按最新版本,它没有任何选项更改一个部分为盒装或全宽,有一个选项可以更改背景图像,但它会看起来像这样,一旦我把它设置为我的背景图像:





C我在第二张图片上实现了盒装布局,只是使用纯CSS作为主要内容背景?

HTML

  //主容器
< div style =background:#ffffff; class =row one-column cf ui-sortableid =le_body_row_4>
< div class =fixed-width>
< div class =one-column column colsid =le_body_row_4_col_1>
//图片html在这里
..更多html
< / div>
< / div>
< / div>

谢谢

解决方案首先,你使用的是 table ,所以默认情况下, table 将占据整个水平空间,所以使您的容器固定宽度并将 margin:auto; 添加到

  .container {
margin:auto;
overflow:hidden;
padding:0;
职位:亲属;
width:1000px;
}

并使用 background-color:#fff; < div 具有 id #le_body_row_4


God Another Question regarding css the test site again was http://testpress.dramend.com/amend-2/, I currently have this main content as a fullwidth with white background:

But what I want to achieve was this kind of boxed layout with the same white background but it needs to be boxed like this sample:

I'm using wordpress optimized press latest versiom, it doesnt have any options of changing a section to boxed or fullwidth, There's an option to changed the background to an image but it would look like this once I've set it to the my background image:

Can I achieved the boxed layout on the second image just using plain css for the main content background?

HTML

//main container    
<div style="background:#ffffff; class="row one-column cf ui-sortable" id="le_body_row_4" >
   <div class="fixed-width">
      <div class="one-column column cols" id="le_body_row_4_col_1">
       // image html comes here
       .. some more html
      </div>
   </div>
</div>

Thanks

解决方案

First of all you are using table so by default, table will take entire horizontal space, so make your container a fixed width and assign margin: auto; to that

.container {
   margin: auto;
   overflow: hidden;
   padding: 0;
   position: relative;
   width: 1000px;
}

and than use background-color: #fff; on div having id of #le_body_row_4

这篇关于css背景图像被装箱成白色不是全角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆