有没有一种方法可以将html元素定位为绝对值,但仍将其放置在页面中心?

时间:2020-02-17 00:05:11

标签: html css debugging

 .container{
   position: absolute;
   margin: 0 auto;// this doesn't position it in the centre anymore.
 }
<div class="container">
   this is a container
</div>

“应该将其放置在中央...但是当我将其放置为绝对位置时,它又回到了网页的顶部。总有办法绕过它。”

1 个答案:

答案 0 :(得分:0)

这可以做到:

(require syntax/parse/define (only-in racket (#%app racket:#%app)))
(define-syntax-parser #%app
  [(_ {Value1 {~datum +}} ... Value2)
  #'(+ Value1 ... Value2)]

  [(_ Xs ...) 
  #'(racket:#%app Xs ...)]
)
(displayln ({1 +} {2 +} 3))
相关问题