Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我需要将 adiv ('#expand')在容器中居中。可能与容器中的div内容重叠,但只有可见部分(即div重叠内容的左侧或右侧没有边距)这个例子似乎有效(使用另一个容器和自动边距),但我需要它重叠边框的容器。
div ('#expand')
div
我不确定你在寻找什么,确切地说,但如果你想使一个元素居中,你通常会这样做:
div#expand{margin-left:auto;margin-right:auto;}