CSS - 页面上的Allign图像

时间:2016-03-23 11:57:43

标签: html css html5

网站上的

au.advfn.com/forex/charts我试图将当前已分配的四个股票图表中心对齐。

div id="container"

中有

我对css很新,我怎么能这样做?

4 个答案:

答案 0 :(得分:1)

如果您的图表位于div中,请将其添加到div:

Page

答案 1 :(得分:0)

.center {
  margin: auto;
  width: 100%;
  border: 0px solid #000000;
  padding: 5px;
}

答案 2 :(得分:0)

CSS更改

#container {
    float: left;
    width: 950px;
    background: #FFFFFF;
    text-align: center;
}
div.chart {
    width: 338px;
    margin-right: 15px;
    margin-bottom: 21px;
    display: inline-block;
}

并删除id为"一个"

的div
<div id="one"></div>

答案 3 :(得分:0)

你有div的“one”id向右浮动,移开它,然后从“chart”css类中删除(float:right),添加(display:inline-block)然后添加'---------------------------------------------------------------------- ' GenerateUniqueName ' ' Generates a file name that doesn't exist by appending a number ' inbetween the base name and the extension. ' Example: GenerateUniqueName("c:\folder\file.ext") = "c:\folder\file_4.ext" '---------------------------------------------------------------------- Function GenerateUniqueName(FullFileName As String, Optional fAlwaysAddNumber As Boolean) As String Dim oFSO As Object Set oFSO = CreateObject("Scripting.FileSystemObject") If Not oFSO.FileExists(FullFileName) And Not fAlwaysAddNumber Then GenerateUniqueName = FullFileName Else Dim strExt As String Dim strNonExt As String Dim strBaseName As String Dim strNewName As String Dim i As Integer strExt = oFSO.GetExtensionName(FullFileName) If strExt <> "" Then strBaseName = oFSO.GetBaseName(FullFileName) If InStrRev(strBaseName, "_") > 0 Then i = Val(Mid(strBaseName, InStrRev(strBaseName, "_") + 1, Len(strBaseName))) strBaseName = Left(strBaseName, InStrRev(strBaseName, "_") - 1) End If strNonExt = oFSO.buildpath(oFSO.GetParentFolderName(FullFileName), strBaseName) Do i = i + 1 strNewName = strNonExt & "_" & i & "." & strExt Loop While oFSO.FileExists(strNewName) GenerateUniqueName = strNewName Else MsgBox "File name must contain a file extension." & vbCr & _ "e.g. .xls or .xlsx", vbCritical + vbOKOnly GenerateUniqueName = "" End If End If Set oFSO = Nothing End Function 标签容器div。那么你将获得以下渲染。

enter image description here