html - 右侧按钮下方的文字
问题描述
我希望文本位于右侧按钮下方,如下所示:
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
| SOME BUTTON |
| |
|_______________________________________|
powered by Company
用不同的 div 等尝试了一切,但不能让它太有效。
.info_button{
border: none;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
background: #E50000;
color: #fff;
width: auto;
text-align: center;
padding: 10px 20px;
cursor: pointer;
/*margin-bottom: 20px;*/
margin-top: 10px;
font-size: 17px;
display: inline-block;
font-weight:330;
}
@media only screen
and (min-device-width : 375px)
and (max-device-width : 812px)
and (-webkit-device-pixel-ratio : 3)
{
.info_button
{
line-height:1.2;
}
}
<div style="text-align: center;"><a class="info_button" href="">Here is a button-text</a>
</div>
<div style="font-size: 10px; text-align: right; margin-bottom: 20px;">powered by companyname</div>
可能这真的很容易,我只是迷路了。
解决方案
保持在同一个div上
.info_button {
border: none;
border-radius: 5px;
background: #E50000;
color: #fff;
padding: 10px 20px;
cursor: pointer;
margin-top: 10px;
font-size: 17px;
display: inline-block;
font-weight: 330;
}
.box {
display:table; /* fit content */
margin:auto; /* center div */
text-align:right; /* push text to right */
}
<div class="box">
<a class="info_button" href="">Here is a button-text</a>
<div style="font-size: 10px; ">powered by companyname</div>
</div>
推荐阅读
- python - Python 将大文本翻译成英文
- javascript - 提交表单后返回上一页&&我的js有副作用
- excel - 变量 = 工作表(=> 预期标识符)
- go - 尝试更新记录,但它插入新的
- excel - 将 Sharepoint / PowerAutomate 日期/时间转换为 Excel 序列日期/时间编号
- amazon-ec2 - ffmpeg 从 EC2 实例上的 Dropbox 转换 2tb 视频
- pandas - 从 Zip Link Pandas 读取多个文件
- python - 我在使用此代码时遇到问题,虽然它可以工作但不是我想要的方式
- amazon-web-services - Amazon Rekognition:如何在导入数据集时为单个图像设置多个标签
- postgresql - Debezium PostgresConnector 实例化主题,因为表中没有数据