| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1045 人关注过本帖
标题:页面居中的问题
只看楼主 加入收藏
小肥羊
Rank: 1
等 级:新手上路
帖 子:46
专家分:3
注 册:2008-11-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
页面居中的问题
我做的一个网页,想让它里面的东西居中显示,可是就是不行,代码如下:
(主要就是想在<body>中添加text-algin:center,我的用的是windows7系统,和这个有没有关系?)
<html xmlns="http://www. >
<head runat="server">
    <title>万里行鞋店</title>
</head>
<body style="  text-align:center">

    <form id="form1" runat="server"  style="background-color:#E0FFFF; height: 698px; width:90%;">
 
    <div style="text-align:center">
    <h2 style="height: 32px">
        <asp:Label ID="Label1" runat="server" Text="万里行鞋店"></asp:Label>
        </h2>
   
     </div>

     <div style="text-align:left">
     <h4>
     
         <asp:Label ID="Label2" runat="server" Text="一、基本信息"></asp:Label>
     
     </h4>
     </div>
   
   
     <div style="height: 72px; text-align:left">
     <p>
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
     
         <asp:Label ID="Label3" runat="server"
             Text="Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. "></asp:Label>
     </p>

     </div>
      <div>
     <h4 style="text-align: left">
     
         <asp:Label ID="Label4" runat="server" Text="二、经营范围"></asp:Label>
     
     </h4>
     </div>
     
       <div style="height: 72px; text-align:left">
     <p>
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
     
         <asp:Label ID="Label5" runat="server"
             Text="Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. "></asp:Label>
     </p>

     </div>
       <div>
     <h4 style="text-align: left">
     
         <asp:Label ID="Label6" runat="server" Text="三、鞋店成员"></asp:Label>
     
     </h4>
     </div>
     
       <div style="height: 72px; text-align:left">
     <p>
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
     
         <asp:Label ID="Label7" runat="server"
             Text="Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. "></asp:Label>
     </p>

     </div>
       <div>
     <h4 style="text-align: left">
     
         <asp:Label ID="Label8" runat="server" Text="四、鞋店制度"></asp:Label>
     
     </h4>
     </div>
     
       <div style="height: 72px; text-align:left">
     <p>
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
     
         <asp:Label ID="Label9" runat="server"
             Text="Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. "></asp:Label>
     </p>

     </div>
       <div>
     <h4 style="text-align: left">
     
         <asp:Label ID="Label10" runat="server" Text="五、客户需知"></asp:Label>
     
     </h4>
     </div>
     
       <div style="height: 72px; text-align:left">
     <p>
     &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
     
         <asp:Label ID="Label11" runat="server"
             Text="Here is the text for my paragraph. It does't matter how long it is, how many space are between the words or when I decide to hit the return key. It will create a new paragraph only when I begin the tag with another one. "></asp:Label>
     </p>

     </div>
   
    </form>
</body>
</html>
但是我把它贴到记事本中运行就可以的,会不会visual studio要设置什么啊?

[ 本帖最后由 小肥羊 于 2009-10-14 20:38 编辑 ]
搜索更多相关主题的帖子: 页面 
2009-10-14 20:33
jedypjd
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:蒙面侠
威 望:9
帖 子:1096
专家分:4969
注 册:2009-7-27
收藏
得分:7 
可能跟系统有关系吧

天涯无岁月,歧路有风尘,百年浑似醉,是非一片云
2009-10-21 19:56
bygg
Rank: 16Rank: 16Rank: 16Rank: 16
来 自:乖乖的心中
等 级:版主
威 望:241
帖 子:13555
专家分:3076
注 册:2006-10-23
收藏
得分:7 
如果不行,直接在div外面加
<center>
...
</center>

飘过~~
2009-10-21 20:42
冯延超
Rank: 2
等 级:论坛游民
帖 子:11
专家分:10
注 册:2009-10-8
收藏
得分:0 
同意楼上的
2009-10-29 18:49
快速回复:页面居中的问题
数据加载中...
 
   



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

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