【发布时间】:2021-08-10 07:08:56
【问题描述】:
this is who it supposed to look
这里是 HTML
<section class="right">
<h2>Watch your Head </h2>
<p>Ultimate Frisbee is a sport that I never played myself, but it's popularity is something hard to ignore
in many Midwestern college towns. Students (and people who wish they were still students) spend the few
briefs months of good weather, sprinting down fields, hurling frisbees, and yelling "Stack!!".</p>
<p>What I find much more entertaining is the large number of people who continue to play when the weather
gets windy and the night sky darkens around oh....4:15pm. The sight of frisbees boomeranging in the wind
is topped only by the knowledge that even when you can't seem, those same plastic discs of death are
probably hurtling through the dark night sky at 8 or 9 o'clock in the evening.
</p>
<p>Ultimate Frisbee requires a great deal of stamina and dexterity. Not surprisingly, the <abbr
title="International Olympic Committee">IOC</abbr> officially recognized Ultimate as a sport in
2015. It can go up against other sports for inclusion in Olympic games.</p>
</section>
Fixed 不允许文本保持不变。请告诉我我做错了什么?
.right {
position: fixed;
top: 30%;
left: 30%;
transform: translate(-50%,-50%);
width: 200px;
height: 50px;
padding: 20px;
font-size: 16px;
text-align: inherit;
}
【问题讨论】:
-
你为什么使用固定位置。
-
无法触摸 HTML 文件,只能创建我正在尝试的 css。老师的编码风格有点奇怪,没有divs、ids、uls、lis。这会更容易。