HTML5 + CSS3 VS标准HTML 4 [关闭](HTML5 + CSS3 VS Standard HTML 4 [closed])
在环顾互联网时,我无法找到HTML5和标准HTML4的理想比较。 我知道HTML5的一些优点,如多媒体和新组件等。但我正在寻找两者的良好比较。 例如,我在脑海中有以下问题。
- HTML5优于标准HTML4的主要优点是什么(我知道很多)
- 使用HTML5有什么缺点(IE9之前不起作用)
- 使用带有CSS3的HTML5与使用CSS的标准HTML4相比有什么优缺点。
在这里,我正在寻找使用HTML5和CSS3的优点和缺点。
谢谢你的时间。
As looking around the internet I am not able to find the desired comparison of HTML5 and standard HTML4. I know some of advantages of HTML5 like multimedia and new components etc. But I am looking for a nice comparison of both of these. For example I have following questions in my mind.
- What are the major advantages of HTML5 over standard HTML4 (I know of many)
- What are disadvantages of using HTML5 (Except it does not work before IE9)
- What are the advantages and disadvantages using HTML5 with CSS3 over standar HTML4 with CSS.
Here I am looking for both the advantages and disadvantages of using HTML5 and CSS3.
Thanks for time.
原文:https://stackoverflow.com/questions/14576463
最满意答案
Unindent
main()
以及它下面的内容,现在它是Temp
不是独立函数的方法。 您实际上是在尝试调用没有Temp
实例的方法。缩进是python如何确定方法,类,循环中的内容。 看这里:
编辑 :
class Temp(): def __init__(self): # this method is in Temp pass def prettyPrint(self): # this method is also in temp print("I'm in temp") def prettyPrint(self): #this is not in Temp (notice the indentation change) print("I'm not in temp") if __name__ == "__main__": #this is not in temp either t = Temp() t.prettyPrint() prettyPrint(None)
Unindent
main()
and what's below it, right now it's a method ofTemp
not standalone function. You're essentially trying to call a method without an instance ofTemp
.Indentation is how python determines what is in a method, class, loop or not. See here:
EDIT:
class Temp(): def __init__(self): # this method is in Temp pass def prettyPrint(self): # this method is also in temp print("I'm in temp") def prettyPrint(self): #this is not in Temp (notice the indentation change) print("I'm not in temp") if __name__ == "__main__": #this is not in temp either t = Temp() t.prettyPrint() prettyPrint(None)
相关问答
更多-
查看关于重建的SQLAlchemy文档 : 从数据库行重新创建对象时,SQLAlchemy ORM不会调用__init__ 。 ORM的过程有点类似Python标准库的pickle模块,调用低级__new__方法,然后直接在实例上静静地恢复属性,而不是调用__init__ 。 如果您需要在数据库加载的实例准备就绪之前对其进行设置,则可以使用@reconstructor修饰器将方法标记为__init__的ORM对象。 每次加载或重建实例时,SQLAlchemy都会在没有参数的情况下调用此方法。 这对重新创建通 ...
-
如何在__init__期间对异常调用__exit__方法?(How to call __exit__ method on exception during __init__?)[2022-12-09]
显然你不能使用不能作为上下文管理器启动的类,所以你必须在with块中使用它之前创建实例。 例如: try: ins = MyClass() except Exception as e: print "Cant initiate MyClass" else: with ins: pass 您可以通过将它们传递给Class来添加额外资源,而不是在启动期间创建它们: with spawnResource() as res, MyClass(res) as y: ... -
首先,你应该明白这一点 class Foo(object): bar = ['baz'] 和 class Foo(object): def __init__(self): self.bar = ['baz'] 意思是非常不同的东西,在第一种情况下, bar是一个类属性,对于Foo所有实例以及类Foo本身(它是type的实例,而不是Foo )是相同的,但是在第二个bar是Foo的每个实例的一个属性,并且根本不与该类关联! 如果你尝试这两种方法,并追加到bar ,首先, ...
-
重新运行__init__方法(Rerunning __init__ method)[2022-04-03]
为什么不把初始化代码放在一个方法中,并从init调用它以及从中调用它需要的其他位置呢? Why not just put your initialisation code in a method and call it from init as well as the other locations you need it called from? -
在这种情况下,我认为夹具没有任何好处。 我只想在测试方法中创建对象。 有一个带有默认值的可选参数,然后在缺少参数时引发异常似乎很奇怪。 除非您确实需要自定义错误消息,否则请考虑删除默认值。 I don't see any benefit to the fixture in this situation. I would just create the object in the test method. Having an optional parameter with a default value an ...
-
我相信这是高速公路本身的一个微妙的错误。 图书馆应该尽早初始化所有跑步者的属性。 请在错误跟踪器上提交问题 I believe it's a subtle bug in Autobahn itself. The library should initialize all runner's attributes early. Please file an issue on bug tracker
-
zmq PUBhandler无法在__init __()方法中使用(zmq PUBhandler could not be used in __init__() method)[2023-06-13]
来自pyzmq所有者minrk的回答: 您无法在使用多处理实例化子进程时发生的fork边界上传递zmq上下文或套接字。 您必须确保在进入子流程后创建Context 。 解: def work(): worker = LogWorker(port) worker.log_worker() workers = [ Process(target=work) for _ in range(n) ] answer from pyzmq owner minrk: You cannot pass zm ... -
__init__方法给出异常(__init__ method giving exception)[2024-03-01]
Unindent main()以及它下面的内容,现在它是Temp不是独立函数的方法。 您实际上是在尝试调用没有Temp实例的方法。 缩进是python如何确定方法,类,循环中的内容。 看这里: 编辑 : class Temp(): def __init__(self): # this method is in Temp pass def prettyPrint(self): # this method is also in temp ... -
这里的原因是: super(Main1,self).__init__(master) 将依次称之为: def create_wdgts(self): 这反过来会这样做: self.pointbttn["command"]= self.pointhndlr() 这不会将函数 self.pointhndlr给self.pointbttn["command"] ,而是调用self.pointhndlr ,并将结果self.pointbttn["command"] 。 解决方案:删除括号: self.poin ...
-
你的init方法期望我的参数被初始化,而你的代码的另一个问题是self.bag将永远不会初始化为一个列表,如果len(i)不为零,如果它没有定义为list,那么你可以追加到bag之前。 下面的代码应该适合你想要的 class Bag: def __init__(self, i=None): self.bag = [] if i == None: pass # i is None, do nothing after create empty ba ...