我有一个并排设置,使用 div 容器(2 个容器在一个容器中),并且我无法让右侧与我的浮动右侧对齐到顶部
我已经弄清楚如何让我的两个部分并排出现在我的 div 容器中。左侧是幻灯片和幻灯片。正是我希望它出现的位置/方式,但右侧不会与顶部对齐。
我添加了额外的措辞,看看这是否会将其全部“推”到顶部,但它一直在下降。我尝试将vertical-align top添加到.alignright,以及我在这里找到的所有其他对齐解决方案。在其他网站上。
向右浮动的alignright必须保留,否则所有文字都会向左移动,在幻灯片旁边向右移动(看起来很糟糕)。 我已附上当前输出。 “在过去”我会 valign=top &然后,但这没有效果。
<div class = "text">
<p class ="alignright">
Save a Life
<br>
images go here
<br>
Donate Now
<br>
TEXT
</p>
</div>
.alignright {
float: right;
.text {
color: #0000A0;
font-family: Georgia,Times,Times New Roman,serif;
font-size: 80px;
font-weight: bold;
}
I have figured out how to get my 2 sections to appear side-by-side within my div container. The left side is a slideshow & is exactly where/how I want it to appear, but the right side won't align to the top.
I have added extra verbiage to see if that would "push" it all to the top, but it kept going lower. I've tried adding vertical-align top to .alignright, along with all the other solutions for alignment I have found here & on other sites.
The alignright being a float to the right has to stay or the verbiage all shifts left, right up next to the slideshow (and looks horrible).
I've attached the current output. "In the olden days" I would valign=top & then , but that has no effect.
<div class = "text">
<p class ="alignright">
Save a Life
<br>
images go here
<br>
Donate Now
<br>
TEXT
</p>
</div>
.alignright {
float: right;
.text {
color: #0000A0;
font-family: Georgia,Times,Times New Roman,serif;
font-size: 80px;
font-weight: bold;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)