哪种设计更好,为什么 [英] which design is better and why

查看:87
本文介绍了哪种设计更好,为什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



一般的讨论我想知道哪种写div的方式对于设计网页表格有好处。



例如

1)

Hi,
its a general discussion i want to know which way of writing the div is good for designing a web form.

for eg
1)

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <asp:TextBox ID="TextBox1" BorderColor="AliceBlue" runat="server"></asp:TextBox>
    </div>
      <div>
    <asp:TextBox ID="TextBox2" BorderColor="AliceBlue" runat="server"></asp:TextBox>
    </div>
    </form>

</body>
</html>





在上面的代码中我们没有父div标签我们是有两个div标签。



第二个例如





in the above code we don't have parent div tag we are having two div tag.

2nd eg

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <div>
        <asp:Button ID="Button1" runat="server" Text="Button" />
        </div>
     <div>
      <asp:Button ID="Button2" runat="server" Text="Button" />

     </div>
    </div>
    </form>
</body>
</html>





在上面的例子中我们有一个父div和里面有两个DIV



所以我想知道哪一个更好的设计表格或两者都相同它的剂量效果任何诸如放大或缩小,最小化和最大化屏幕之类的东西。



in the above example we are having a parent div and inside that there are two DIV

so i want to know which one is better in designing a form or both are same it dosent effect any thing such as zoom in or zoom out , minimize and maximize of screen.

推荐答案

在我看来,由于两者在浏览器屏幕上呈现相同的设计,你可以使用任何一。但是,我仍然会选择第二个 - 带有父div标签的那个,因为当我们处于pre-div时代时,使用表格进行页面结构,我们曾经在p标签上有一个td,并且在td标签,显然,tr标签上的一个表。



所以我想说的是,如果我是你,我会选择每个子标签都有父标签的设计,我不会离开没有任何支持/父标记的任何div标签悬挂在花园中。



这有助于在将来添加任何更多标签,无需进行太多设计编码更改。



谢谢
In my view, since both render same design on the browser screen, you can use any one. But still, i would go with the second one - the one with parent div tag because while we were in pre-div era, using tables for page structure, we used to have a td on the p tag, and have a tr on the td tag and obviously, a table on the tr tag.

So what i am trying to say is if i were you, i would go for a design that has parent tags for each of the child tag and i would not leave any div tag hanging in the garden without any support/parent tag.

This helps in adding any more tag in future as an when needed, without much design coding alterations.

Thanks


这篇关于哪种设计更好,为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆