水平和垂直居中的前标签没有使用表? [英] Horizontally and vertically center a pre tag without the use of tables?

查看:134
本文介绍了水平和垂直居中的前标签没有使用表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可以水平和垂直对齐不含表格的预标记吗?我想在网页上垂直和水平排列某些 ASCII艺术。虽然我已经使用表格生成了成功的适应,但我想知道是否可以将其转换为使用其他元素和CSS。 每个ASCII艺术品的高度和宽度都不同,所以重要的是注意,我的问题的解决方案必须涉及到没有固定的高度或宽度要求。

Is it possible to horizontally and vertically align a pre tag without tables? I want to vertically and horizontally align some ASCII art on a webpage. While I have already produced a successful adaption using tables, I want to know if its possible to convert it to using other elements and CSS. Every piece of ASCII art is a different height and width, so therefore it is important to note that the solution to my issue must involve not having a fixed height or width requirement.

谢谢。

推荐答案

a href =http://tutorialzine.com/2010/03/centering-div-vertically-and-horizo​​ntally/ =nofollow> http://tutorialzine.com/2010/03/centering-div-vertically和水平/

Throw er in a div and center that div one of these ways http://tutorialzine.com/2010/03/centering-div-vertically-and-horizontally/

这篇关于水平和垂直居中的前标签没有使用表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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