| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 707 人关注过本帖
标题:菜鸟级新手求高手解决P标签问题
只看楼主 加入收藏
sakari1988
Rank: 1
来 自:芬兰
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-1-6
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
菜鸟级新手求高手解决P标签问题
最近自学做网站,刚好学校有门课是让自己选择两种编程语言,学会后做出一样东西来,我选了HTML和CSS,打算做静态网站,编码如下:
<html>
    <head>
        <title>Finlandinfo</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <style>
            table.cla1{
                width:1000;
                text-align:center;
                font-size:15px;
            }
            td{
            width:800;
            height:30px;
            cellspacing: 80px;
            background-color:#A0A0A0 ;
            text-align:center;
            
            }
            p.cla1{
            align:center;
            width:1000;
            }
        </style>
    </head>
    <body>
        <table class="cla1" align="center">
            <tr>
                <td><a href="home.html">Home</a></td>
                <td><a href="permits.html">Permits</a></td>
                <td><a href="accommondation.html">Accommondation</a></td>
                <td><a href="work.html">Work</a></td>
                <td><a href="education.html">Education</a></td>
                <td><a href="health.html">Health</a></td>
                <td><a href="social.html">Social Services</a></td>
            </tr>
        </table>
        <p class="cla1" align="center">
        You have accessed these pages because you are contemplating immigration to Finland or because you are already resident in Finland.
        </p>
               
    </body>
</html>
导航长度已固定,接下来就是段落P标签的东西, 打算让P标签的每行文字长度与导航长度相同并居中,但是在style里面,P.cla1里我输入align:center之后,想让其长度定为跟导航长度一样:width:1000;但是这个时候P标签之内的align:center就不居中了,并且背景颜色长度超过导航长度,尽管已经设定了长度是1000,截图如下

搜索更多相关主题的帖子: 编程语言 做网站 content center title 
2012-01-06 08:46
zhaoxueyan
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2012-1-5
收藏
得分:0 
把align="center"变成 margin:0 auto;
2012-01-06 20:57
sakari1988
Rank: 1
来 自:芬兰
等 级:新手上路
帖 子:2
专家分:0
注 册:2012-1-6
收藏
得分:0 
回复 2楼 zhaoxueyan
试了,还是不行,还是谢谢你···
2012-01-06 23:58
lcybeyond
Rank: 2
等 级:论坛游民
帖 子:1
专家分:20
注 册:2012-1-7
收藏
得分:20 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
    <head>
        <title>Finlandinfo</title>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
        <style>
            table.cla1{
                width:1000px;
                text-align:center;
                font-size:15px;
            }
            td{
            width:800;
            height:30px;
            cellspacing: 80px;
            background-color:#A0A0A0 ;
            text-align:center;
            
            }
            p.cla1{
            width:1000px;
        margin:0px auto;
            }
        </style>
    </head>
    <body>
        <table class="cla1" align="center">
            <tr>
                <td><a href="home.html">Home</a></td>
                <td><a href="permits.html">Permits</a></td>
                <td><a href="accommondation.html">Accommondation</a></td>
                <td><a href="work.html">Work</a></td>
                <td><a href="education.html">Education</a></td>
                <td><a href="health.html">Health</a></td>
                <td><a href="social.html">Social Services</a></td>
            </tr>
        </table>
        <p class="cla1">
        You have accessed these pages because you are contemplating immigration to Finland or because you are already resident in Finland.
        </p>
               
    </body>
</html>
2012-01-07 22:10
快速回复:菜鸟级新手求高手解决P标签问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.033341 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved