html - 尝试居中对齐 Ebay 模板 - 但不起作用

标签 html css

好的,我正在尝试为我的 ebay 列表创建一个 Ebay 模板,我正在解决问题,我们将不胜感激任何帮助。我试图将我的模板置于列表描述的中心,这样无论屏幕大小如何,它都可以居中。我看到其他列表有它,所以我知道它可能是我无法弄清楚的。

现在,列表位于页面的左侧。我需要它居中。当我添加代码时 <div align="center">它在预览中有效,但当我真正接受修改时,模板在巨大的白色海洋中丢失了,你必须滚动数英里的白色才能找到它。

我需要一些方法来减小要添加列表的白框的大小,以便我可以将其居中,或者想出任何其他方法来实现这一点。这是有和没有一行修改的第一段代码。感谢您的时间和耐心,我确实在其他线程上寻找过这个但找不到任何确切的东西,我尝试了一些但没有任何效果。请帮忙! :) 谢谢!

<meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>Untitled 1</title><style type="text/css">
.auto-style1 {
background-color: #3A3428;
}
.auto-style2 {
text-align: center;
}
.auto-style13 {
background-color: #3A3428;
}
.auto-style10 {
text-align: left;
}
.auto-style12 {
text-align: center;
}
.auto-style11 {
vertical-align: middle;
}
h1 {
font-family:Cambria, "Hoefler Text", "Liberation Serif", Times, "Times New Roman", serif;
font-size:22px;
font-weight:bold;
}
.auto-style5 {
font-size: 16pt;
}
.auto-style7 {
text-align: right;
}
.auto-style9 {
font-size: 20pt;
text-align: left;
}
.auto-style8 {
font-size: 20pt;
}
.auto-style14 {
font-size: 24pt;
text-align: center;
}
.auto-style15 {
font-size: 12pt;
text-align: center;
}
.auto-style16 {
font-size: 12pt;
}
</style><table class="auto-style1" style="text-align: center; width: 1130px; height: 2200px;"><tbody><tr><td class="auto-style2" valign="top"><table width="749" border="0" align="center" cellpadding="0" cellspacing="0" style="text-align: left;"><tbody><tr><td width="749" class="auto-style13"><img

图像源已删除,因为我是一个菜鸟哈哈。

编辑:好的 - 我取得了一些小进展。我继续添加了一个基于容器的代码,其长度和宽度为 1200px ea。然后我输入了以 Div 为中心的代码,它似乎起作用了!但只能在 Internet Explorer 上????哈哈 CRIES 它在 Chrome 上仍然是一片巨大的白色海洋,但在 IE 上完美无缺。哦亲爱的? :( 期待一些建议 - 谢谢任何人!!

IE 上的屏幕截图:http://gyazo.com/75a67d313f92573b81c2fe8e7fbff192

Chrome 上的屏幕截图:http://gyazo.com/15c8d7455d6f2e10b968f6b09f04da69

IE 是完美的!! Chrome 被搞砸了???什么在这里大声笑。谢谢

最佳答案

最好的办法是创建一个宽度为 100% 的包装器,然后是一个固定宽度的内部包装器,边距设置为自动,然后将所有内容 float 在其中。这一直对我有用,我以 build 这些为生。 float 使 iframe 保持正确的高度,包装器和内部保持其居中。

<div id="wrapper">
    <div id="inner">
        <div id="header">...</div>
        <div id="content">...</div>
        <div id="footer">...</div>
    </div>
</div>

<style>
    #wrapper {width:100%;float:left;}
    #inner {width:960px;margin:auto;}
    #footer, #content, #header {width:960px;float:left;}
</style>

关于html - 尝试居中对齐 Ebay 模板 - 但不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25906845/

相关文章:

javascript - 使用 jquery CounterUp 给出 NaN 的百万值

html - 如何从移动 View 中删除数据库

html - 选择元素下拉列表的最大高度(选项元素)

javascript - 更改部分关注 Foundation CSS 中的按钮单击

jquery - 如何按内容拉伸(stretch)表格的一列并相应地减少其他列的宽度?

html - 手机响应式网站

javascript - fadetoggle 2 倍如何(初学者)

html - Z-index 适用于 Firefox 和 IE,但不适用于 Chrome

需要 HTML textarea 标签帮助

html - 有人可以解释为什么我的页脚在页面中间吗?