有没有为纯粹的CSS布局努力的商业理由? [英] Is there a business reason for striving for pure CSS layout?

查看:55
本文介绍了有没有为纯粹的CSS布局努力的商业理由?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

似乎每次我尝试创建一个纯CSS布局,它需要的时间比我使用一两张表还要长。

It seems like every time I try to create a pure CSS layout it takes me much longer than if I'd use a table or two. Getting three columns to be equal lengths with different amounts of data seems to require particular fancy hacks, especially when dealing with cross-browser issues.

我的问题:

这几张桌子会伤害谁?

Who are these few tables going to hurt?

表似乎在表格数据上效果特别好。为什么他们在这个日子和年龄如此被耻辱? Google.com在其源代码中有一个表,所以在许多其他网站(stackoverflow.com不顺便)。

Tables seem to work particularly well on tabular data — why are they so reviled in this day and age? Google.com has a table in its source code, so do many other sites (stackoverflow.com does not by the way).

推荐答案

p>由于这是堆栈溢出,我会给你我的程序员答案

Since this is stackoverflow, I'll give you my programmer's answer

首先看看这段代码,想想这里有什么问题...

First take a look at this code and think about what's wrong here...

class car {
    int wheels = 4;
    string engine;
}

car mybike = new car();
mybike.wheels = 2;
mybike.engine = null;

问题当然是,一辆自行车不是一辆汽车。汽车类是自行车实例不适当的类。代码是无错误的,但语义上不正确。

The problem, of course, is that a bike is not a car. The car class is an inappropriate class for the bike instance. The code is error-free, but is semantically incorrect. It reflects poorly on the programmer.

现在将其应用于文档标记。如果您的文档需要提供表格数据,那么相应的标记将是< table> 。但是,如果将导航放置到表中,则表示您错误地使用了< table> 元素的预期用途。在第二种情况下,你不是提供表格数据 - 你是(mis)使用< table> 元素来实现一个表现目标。

Now apply this to document markup. If your document needs to present tabular data, then the appropriate tag would be <table>. If you place navigation into a table however, then you're misusing the intended purpose of the <table> element. In the second case, you're not presenting tabular data -- you're (mis)using the <table> element to achieve a presentational goal.

这个伤害了谁?没有人。如果你使用语义标记,谁会有好处?你 - 和你的专业信誉。现在去做正确的事情。

Whom does this hurt? No one. Who benefits if you use semantic markup? You -- and your professional reputation. Now go and do the right thing.

这篇关于有没有为纯粹的CSS布局努力的商业理由?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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