0

我正在尝试在中心定位链接,即假设我们有以下代码

<html  >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<body bgcolor="blue">

<a href="indexE.html"><img src ='english.gif' style="float:right"  width="88" height="88"> </a>
<a href="indexR.html"><img src ='russian.gif' alt="Russian flag" style="float:right"  width="88" height="88"/>
<a href="index.html"> <img src="georgian.jpg"  style="float:right" width="88" height="88"/>
<a href="index.html">მთავარი </a>

</body>
</html>

这里 (მთავარი)(mtavari) 表示主要,只是我正在将网站改成英语、格鲁吉亚语和俄语,我希望它在中心定位主要 (მთავარი),你能帮我吗?还有如何放大文本?

编辑:

<html  >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>
<style>
#links {
    margin: 0 auto;
    width:1050px; 
     font-size:70px

}
</style>
<body bgcolor="blue" >
<a href="indexE.html"><img src ='english.gif' style="float:right"  width="88" height="88"> </a>
<a href="indexR.html"><img src ='russian.gif' alt="Russian flag" style="float:right"  width="88" height="88"/>
<a href="index.html"> <img src="georgian.jpg"  style="float:right" width="88" height="88"/>
<div id="links">

<a href="index.html">მთავარი </a>
</div>
<div id="links">
<a href="ბაკურიანი.html">ბაკურიანი </a>
</div>
<div id="links">
<a href="გუდაური.html">გუდაური </a>
</div>
<div id="links">
<a href="ზღვა.html">ზღვა </a>
</div>
<div id="links">
<a href="კახეთი.html">კახეთი </a>
</div>
<div id="links">
<a href="სვანეთი.html">სვანეთი </a>
</div>
<div id="links">
<a href="ვარძია.html">ვარძია </a>
</div>
<a href="ქართლი.html">ქართლი </a>
</div>
<div id="links">
<a href="ძველი_თბილისი.html">ძველი_თბილისი </a>
</div>
</body>
</html>
4

2 回答 2

1

您是在谈论将链接置于页面中心吗?然后你冷使用css:将标签包装在一个div中,然后将div居中。为了使 div 居中,您需要为其分配一个宽度。例如,我选择了 600px。您还缺少一对关闭标签的夫妇。

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
</head>

<style>
#links {
    margin: 0 auto;
    width: 600px;   
}

#test { 
    margin: 0 auto; 
    width: 400px; 
    clear: both; 
    display: block;
}
#test a {
    float: right;
}

</style>

<body bgcolor="blue">

<div id="links">
    <a href="indexE.html"><img src ='english.gif' style="float:right"  width="88" height="88"> </a>
    <a href="indexR.html"><img src ='russian.gif' alt="Russian flag" style="float:right"  width="88" height="88"/></a>
    <a href="index.html"> <img src="georgian.jpg"  style="float:right" width="88" height="88"/></a>
</div>

<div id="test">
    <a href="index.html">test1</a>
    <a href="index.html">test2</a>
    <a href="index.html">test3</a>
    <a href="index.html">test4</a>
    <a href="index.html">test5</a>
</div>

</body>
</html>
于 2012-07-17T07:05:38.690 回答
1

只需将 text-align: center 放在包含元素的位置,在这种情况下为主体。

其次,您忘记了一些结束锚标记 (</a>)。最后,您应该将样式更改为 CSS 而不是内联。

<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <style>
            body {
                background-color: blue;
                text-align: center;
            }
            .flag {
                float: right;
                height: 88px;
                width: 88px;
            }
        </style>
    </head>
    <body>
        <a href="indexE.html"><img class="flag" src='english.gif'></a>
        <a href="indexR.html"><img class="flag" src='russian.gif' alt="Russian flag"/></a>
        <a href="index.html" ><img class="flag" src='georgian.jpg'/></a>
        <a href="index.html">მთავარი </a>
    </body>
</html>
于 2012-07-17T07:07:30.503 回答