asp.net - 设计会在浏览器中受到影响吗?

标签 asp.net css html

当我在 asp.net3.5 中使用 div 和 css 设计我的网络表单时,在设计中表单看起来没有正确对齐(所有控件分散在 evrywer 中),但是当我查看浏览器时它显示我对齐得很好?这是怎么发生的?它会影响 future 吗? 这是表单代码之一

    <div id="SRForm">  
        <h1>Room Reservation</h1>


            <div id="SRLeft">
                <ul>
                            <li>Check Availability</li>
                            <li class="status">Select Room</li>
                            <li>Enter Details </li>
                            <li>Review Reservation & Confirm</li>
                </ul>

            </div>

           <div id="RoomType"> 

            <div id="Room1">
               <div class="imgdetails">
                    <img  class="SRimg" src="images/rooms/regular-room.jpg"/>
               </div>
               <div class="roomdetails">
                    <h3>Regular Room</h3>
                    <asp:Label runat="server" id="lblroom1" class="lblroom">Available:</asp:Label>
                    <asp:Label runat="server" id="lblroom2" class="lblroom">no of rooms</asp:Label>
                    <p class="roompara">Well appointed environment friendly rooms with all the facilities available.</p>
                    <asp:CheckBox ID="CheckBox1" runat="server" />
                    <asp:DropDownList ID="cboroom1" class="cboroom" runat="server">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div >
                </div>
           </div>

           <div id="Room2">
               <div class="imgdetails">
                    <img  class="SRimg" src="images/rooms/regular-room.jpg"/>
                </div>
                <div class="roomdetails">
                    <h3>Delux Room</h3>
                    <asp:Label ID="lblroom3" runat="server" class="lblroom">Available:</asp:Label>
                    <asp:Label ID="lblroom4" runat="server" class="lblroom">no of rooms</asp:Label>

                    <p class="roompara">Well appointed environment friendly rooms with all the facilities available.</p>
                    <asp:CheckBox ID="CheckBox2" runat="server" />
                    <asp:DropDownList ID="DropDownList2" class="cboroom" runat="server">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                    </asp:DropDownList>

                </div>
                <div class="rate">
                <p class="proom">Charge Per Night:</p>
                <asp:label runat="server" class="lblrate">3000INR</asp:label>
                </div>
           </div>

           <div id="Room3">
               <div class="imgdetails">
                    <img  class="SRimg" src="images/rooms/regular-room.jpg"/>
                </div>
                <div class="roomdetails">
                    <h3>Super-Delux Room</h3>
                    <asp:Label ID="lblroom5" runat="server" class="lblroom">Available:</asp:Label>
                    <asp:Label ID="lblroom6" runat="server" class="lblroom">no of rooms</asp:Label>

                    <p class="roompara">Well appointed environment friendly rooms with all the facilities available.</p>
                    <asp:CheckBox ID="CheckBox3" runat="server" />
                    <asp:DropDownList ID="DropDownList3" class="cboroom" runat="server">
                        <asp:ListItem>1</asp:ListItem>
                        <asp:ListItem>2</asp:ListItem>
                        <asp:ListItem>3</asp:ListItem>
                    </asp:DropDownList>
                </div>
                <div  >
                </div>
           </div>
         </div>     
       </div>


here is css

#SRForm { margin:0; padding:0; width:900px; height:700px;}
#SRForm h1 { text-align:center; font-size:20px; margin: 20px 0; font-weight:bold;}

    #SRLeft      { width:200px; float:left; padding:10px 10px; margin-right:10px; }
    #SRLeft ul   { list-style:none; margin:0; padding:0; height: 160px;}    
    #SRLeft li   {  margin:0; padding:0; list-style:none; float:right;
                        position:relative; padding:5px 5px 5px 5px; font-weight:bold;
                        width:180px;}
    #SRLeft li a { text-align:center; display:block; width:180px; float:right;}

    #RoomType    { width: 650px; float:left; height:700px;
                    }

    #Room1 {float:left; width:630px; margin-bottom:10px; height:230px; border:2px solid #FFF; }
    #Room2 {float:left; width:630px; margin-bottom:10px; height:230px;  border:2px solid #FFF;}

    #Room3 {float:left; width:630px; margin-bottom:10px; height:230px;  border:2px solid #FFF;}


    .roompara{ width:380px;font-size:14px;}
    .imgdetails { width:240px; margin:2px 2px 2px 2px;}
    .roomdetails { width:380px; float:left;}
    .roomdetails h3 { font-weight:bold; text-align:center; width:380px; margin-top:5px;}
    .lblroom        { margin-top:2px; padding:3px;}
    .cboroom        { width:100px;}
    .rate           { width:630px; margin-left:5px; float:left; height:50px;}
    .SRbtn          { float:right; margin-bottom:10px;}
    .proom          { font-weight:bold;}
    .lblrate        { float:left; position:absolute; margin-left:100px;}


/*----images in Rooms---*/
.SRimg { border:4px solid #eee; margin:5px 5px 5px 5px; width:200px; float:left;
    height: 150px;
}

此外,该费率与每晚标签收费不一致。 请告诉我错误是什么。

最佳答案

Please tell whats the mistake.

你的错误是使用了 asp.net...那是开玩笑的回复,不要打倒我。

我假设您使用某种设计 View ?除非你从一开始就把它弄对了,否则你会遇到一大堆布局问题。我倾向于使用重置样式表,就像这里找到的一样 - http://meyerweb.com/eric/tools/css/reset/

关于asp.net - 设计会在浏览器中受到影响吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9464956/

相关文章:

c# - 为什么我的 WebClient 上传文件代码挂起?

c# - Web.config 导致 "blocked by group policy"错误

javascript - Fabric.js : Change one or multiple selection square/rectangle color

html - 如何在CSS中显示随机句子

css - 重写CSS中字体的规则

html - margin-top百分比是如何计算的?

javascript - 获取与javascript中特定路径匹配的所有href

asp.net - 用于文档存储库的开源/免费 ASP.NET Webcontrol

jquery - 如何有条件地将 jQuery Sortable UI 小部件应用到表(ASP.NET GridView)?

css - 用于提取页面可见部分中使用的 CSS 的工具