Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html <;td>;文本居中,但文本左对齐_Html_Html Table_Vertical Alignment_Text Align - Fatal编程技术网

Html <;td>;文本居中,但文本左对齐

Html <;td>;文本居中,但文本左对齐,html,html-table,vertical-alignment,text-align,Html,Html Table,Vertical Alignment,Text Align,我知道我错过了一个简单的线路修复 我尝试了,而,反之亦然。我还为玩过简单的align=“left” 如何使所有文本在中居中,但链接在中间左对齐 到目前为止,文本是左对齐的,但在 我还尝试添加一个居中的div,您将在我的代码中看到。没用 <td align="center" width="50%" style = "margin-left:50%"> <p align="center"><font size="5"><b&

我知道我错过了一个简单的线路修复

我尝试了
,而

,反之亦然。我还为
玩过简单的
align=“left”


如何使所有文本在中居中,但链接在中间左对齐

到目前为止,文本是左对齐的,但在

我还尝试添加一个居中的div,您将在我的代码中看到。没用

        <td align="center" width="50%" style = "margin-left:50%">
        <p align="center"><font size="5"><b>Classified Ads</b></font></p>
        <br />

        <div align="center">

        <strong><!--edited 6/10/2015-->
                              <p style="text-align:left;">
                              <a href=".aspx">Search Classified Ads</a></p>                                  
                              <p style="text-align:left;">
                                 <a href=".aspx">Add or Delete Classified Ad</a></p>
                              <p style="text-align:left;">
                                 <a href=".aspx">Update Existing Classified Ad</a></p>
                              <p style="text-align:left;">
                                 <a href=".aspx">All Classified Ads</a></p>

                              <p style="text-align:left;">
                                 <a href=".aspx">About this Application</a></p>
         </strong>

        </div>
                              <p>
                                &nbsp;
                              </p>
                              <p>

                              </p>
                              <p align="center">
                              <strong>

                                    <font size="+1">Note: Classified Ads will expire after 30 days.</font>
                                    <br />
                                    Today&#39;s date is&nbsp;
                                  <asp:Label ID="DateLabel" runat="server"></asp:Label>
                              </strong>

                              </p>

    </td>

分类广告


注意:分类广告将在30天后过期。
今天';s的日期是

更新:

我似乎在解释我想要的是什么。我希望它看起来像这样

<div>
        <p style="text-align:center"><font size="5"><b>Classified Ads</b></font></p>
        <br />

        <div style="width:300px; margin: 0 auto;">

            <strong><!--edited 6/10/2015-->
                <p>
                    <a href=".aspx">Search Classified Ads</a></p>                                  
                <p>
                    <a href=".aspx">Add or Delete Classified Ad</a></p>
                <p>
                    <a href=".aspx">Update Existing Classified Ad</a></p>
                <p>
                    <a href=".aspx">All Classified Ads</a></p>

                <p>
                   <a href=".aspx">About this Application</a></p>
            </strong>

        </div>
        <p>
        &nbsp;
        </p>
            <p style="text-align:center">
                  <strong>

                    <font size="+1">Note: Classified Ads will expire after 30 days.</font>
                    <br />
                    Today&#39;s date is&nbsp;
                </strong>

            </p>


        </div>


分类广告


注意:分类广告将在30天后过期。
今天';s的日期是

我想这是你需要的。首先,当您使用“对齐”或“文本对齐”时,它将自动用于所有子元素。如果要对齐图元,请仅对齐需要对齐的图元。第二件事是居中。您可以使用
边距:0 auto
将块居中(还需要定义宽度,否则它将不起作用)


p.S:我强烈建议您不要在
表之外使用
td
,也不要使用
align
属性。读这篇文章来写一个更清晰的html:

“我如何使所有文本居中,但链接在中间左对齐?”你能重新表述一下吗,我不知道你的意思。你说左对齐是什么意思,要么是一个,要么是另一个。你想让哪个部分居中?因为它看起来很好?我希望图像中的链接在td的中心对齐,而文本本身是左对齐的。不知道该如何重新措辞,所以我道歉。现在链接是左对齐的,我希望现在我希望它们都移到中心。这是网站还是电子邮件?你所做的修复了我的链接问题!如果我不希望您使用align属性,那么我将查看您提供的链接。欣赏这个例子!