将绝对定位的物品居中(Centering an absolutely positioned item)
我有以下文字:
<p>This is the text</p> p { position: absolute; top: 300px; }
我希望它从顶部300px,但在浏览器中居中 (无论宽度),我该怎么做? 谢谢。
I have the following text:
<p>This is the text</p> p { position: absolute; top: 300px; }
I want it to be 300px from the top, but centered in the browser (no matter the width), how would I do this? Thank you.
原文:https://stackoverflow.com/questions/7595589
更新时间:2024-04-24 17:04
最满意答案
只需创建自己的日志记录模块:
import mylogger log_file_handle = mylogger.get_log()
get
方法可以(应该)处理创建新日志文件的所有逻辑(如果尚未创建新日志文件),或者返回已创建的此会话文件的句柄。Just make your own logging module:
import mylogger log_file_handle = mylogger.get_log()
The
get
method can (should) handle all the logic of creating a new logfile if you haven't made one yet, or returning a handle to the already-created-this-session one.
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
听起来不错。 使用较小的解决方案来完成更多本地化的任务 - 每个解决方案可能只需要一个任务 - 并根据需要使用大型解决方案。 另一种方法是不使用二进制引用来完成任务之间的通信。 考虑一种更具弹性的变化耦合,例如使用JSON的HTTP服务。 以这种方式维护向后兼容性要容易得多。 当您需要共享代码时 ,请使用程序集引用。 当您需要共享行为时 ,请考虑使用HTTP服务。 Sounds good to me. Use smaller solutions for more localized sets of task ...
-
Python,在大型模块化程序中保持动态命名的文件(Python, Keeping a dynamically named file open in a large modular program)[2023-10-28]
只需创建自己的日志记录模块: import mylogger log_file_handle = mylogger.get_log() get方法可以(应该)处理创建新日志文件的所有逻辑(如果尚未创建新日志文件),或者返回已创建的此会话文件的句柄。 Just make your own logging module: import mylogger log_file_handle = mylogger.get_log() The get method can (should) handle all ... -
我认为Rails Engines确实是你想要的。 我已经为几个作为引擎提供的应用程序做出了贡献,基本上完成了您所描述的内容。 这是其中一个主要由我开发的: http : //github.com/team-umlaut/umlaut 它并不总是完全直截了当,有很多地方你需要决定如何设置,而Rails文档或明显的约定并不一定会引导你。 我同意(非常有限的)引擎文档并不一定会引导您走这条路。 但是发动机足以完成需要做的事情。 还要给你足够的绳索来悬挂自己并使事情过于复杂。 我建议使用rails plugin n ...
-
如何在多行复杂视图中设置图像和文本? 您实际上正在寻找错误类型的并发症,您需要检查CLKComplicationTemplateModularLargeColumns 。 您可以使用以下代码了解如何创建它: func createTemplateForModularLarge() -> CLKComplicationTemplate { let template = CLKComplicationTemplateModularLargeColumns() template.r ...
-
模块化设计(modular block design)[2023-04-13]
函数调用的开销(特别是几乎没有局部变量)非常小,甚至不值得考虑。 另外,一个好的编译器会在适当的时候内联调用。 我始终认为,良好的工程应该是最优先考虑的事情,因为从良好的设计中获得的总体效率往往比优化小事情更好,并且使整体设计成为意大利面条混乱。 The overhead of a function call (especially with few local variables) is so small that it isn't even worth considering. Plus, a good ... -
打开和关闭文件肯定有成本。 但是,如果您的遗留程序需要一秒或更长时间来响应,那么您将不会注意到。 def func1(): for x in range(1000): x = str(x) with open("test1.txt", "a") as k: k.write(x) 1 loops, best of 3: 2.47 s per loop def func2(): with open("test2.txt", "a") a ...
-
您手动实例化ModuleHandler ,然后调用InitializeModules ,其中创建目录并将其传递给新的合成容器。 然后,此容器用于通过以下行满足该特定ModuleHandler实例的所有导入: cc.ComposeParts(this); 这告诉MEF查找Import属性并使用相应的Export属性修饰的类的实例填充装饰属性。 你缺少的是填充你的frmTasks对象的类似调用。 因此,不满足以下Import并且属性为null : [Import(typeof (Exec.Core.Inter ...
-
vi(或Vim)可以处理它,没问题。 vi (or Vim) can handle it, no problem.