仅使用 HTML 在流体容器中垂直居中 div

vertically center div in fluid container only using HTML

我正在创建代码,我只能编辑 HTML 不允许在 CSS 文件中进行更改。如何仅在 html 中对齐 div 中的所有内容?

使用 style 属性。 例如

  <span style="position:absolute; top:10px; background-color:green;"></span>