English 中文(简体)
内容中心问题
原标题:Centering content issue

任何人能否告诉我,我需要做些什么才能使下页正确集中内容?

我正试图与我前一天早些时候在这里使用的其他东西合作:

#divWrapper {margin:0 auto; text-align:center;} 
#div {text-align:left;}

But this isn t working for me. One of the pages I need help with is here: REDACTED

谢谢。

最佳回答
#main-inner {
    position: relative;
    width: 960px;
    border-top: 3px solid #DADADA;
    margin: 20px auto 0;
    overflow:auto;
    zoom:1;
}

审判。 用此取代现有案文。 它应当集中内容。

问题回答

它需要宽大! 正确工作。

阁下 rap。 否则,宽度将扩大到含蓄元素的范围,从而造成该元素的出现,其宽度需要低于其含蓄元素。

You can only center elements with margin:0 auto when you provide a fixed width from which the margins can position themselves from automatically. So add a fixed with to your wrapper and it should work.

也许你还需要具体说明文字价值:中心;如果你想要把实际内容集中起来的话。

Try this #divWrapper{margin:0 auto; text-align:center;width:960px}

#div {text-align:left;width:500px}

Edit:enter image description here There are typing mistakes in your CSS. Check this updated CSS for margin-inner & margin-inner-right. It will fix your problem

#main-inner {
        float:left;
        position:relative;
        width:100%;
        border-top:3px solid #dadada;
        margin-top:20px;
        margin-right:auto;
        margin-left:auto;
}


#main-inner-right {

        position:relative;
        width:640px;
        text-align:left;
        margin-top:20px;
        margin-right:auto;
        margin-left:auto;
}




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

Drop down background url in Safari Issue

selectBox.selectCSS { background: url(/Images/replacementSelectBackground.png) top left no-repeat height:auto; } I have an issue in Safari only where the image is not rendering on top ...

CSS specific for Safari

How do you target specifically safari in css with styles?

Aligning textarea in a form

Ive used the following css code to align my form elements: form { position:relative; } form input { position:absolute; left:11em; } However, the textarea element is not aligned correctly with the ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

CSS problem with page footer

I have defined my page footer in the css file as: #footer { position: absolute; height: 50px; text-align: center; background: #66CCCC; bottom: 0px; left: 0px; width: 100%; height: ...