2021年4月5日星期一

Text layout relative to div

I have a box and I want to type a h2 top of that box, which floated right. I want h1 to Be in the middle of the box and top of that (I mean center of outside of the box). Thanks!

Html:

<h1>News</h1>  <div class="box"></div>  

CSS:

.box {width: 400px; height: 200px; background-color: red;}  
https://stackoverflow.com/questions/66962852/text-layout-relative-to-div April 06, 2021 at 12:50PM

没有评论:

发表评论