css - 在 div 中居中无序列表与
within
问题描述
有很多类似的问题,但没有一个完全符合我的情况,主要是因为我<br>
在列表中有标签。我需要电子邮件模板的代码,因此我不能使用引导程序或类似的东西。
我只需要将社交媒体链接放在底部的中心,使它们位于页面的中心,并尽可能保持响应。这是一个小提琴 https://jsfiddle.net/w5dtvs9h/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body style="font-family: Arial;">
<div style="max-width: 80%; margin: auto;">
<div style="max-width: 100%; margin: auto;">
<a href="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"><img style="display: block; margin: auto;" src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png"> </a> </div>
<div>Your thoughts mean a lot to us. Your reviews help us learn what we are doing well, what we need to work on, and what we can do to make your experience with Our Company even better. </div>
<div> <span style="font-weight: bold;">Step 1: Follow the links or any (OR ALL!) of the review sites below </span><br><br>
Click the buttons below to go to that site and provide your review.</div>
<div><span style="font-weight: bold;">Give us a rating and review. </span> <br><br>
Choose a star rating and provide your comments.</div>
<h3 style="text-align: center;">THANK YOU!</h3>
<hr>
<div style="width: 100%; margin: auto;">
<ul style="margin: auto; width: 100%;">
<li style="float: left; list-style:none; margin: auto; margin-right:5%; "><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
<li style="float: left; list-style:none; margin: auto; margin-right:5%; "><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
<li style="float: left; list-style:none; margin: auto; margin-right:5%; "><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
</ul>
</div>
</div>
</body>
</html>
谢谢。
解决方案
您可以使用相同的布局,而无需将其更改为表格,而只需更改样式:
<div>
<ul style="margin: auto;display: flex;justify-content: center;">
<li style="list-style:none;margin-right:5%;"><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
<li style="list-style:none;margin-right:5%;"><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
<li style="list-style:none;margin-right:5%;"><img src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png" style="max-width: 50px; max-height: 50px;display: block; margin: auto;"><br> Google</li>
</ul>
</div>
推荐阅读
- unity3d - 即使在 Unity vuforia 中丢失目标后也播放视频?
- python - 即使使用 access_type='offline',Google OAuth2 也不会发出刷新令牌?
- video - 适用于原生 iPhone 和 Android 视频播放器的视频脚本
- google-bigquery - 使用标准 SQL 访问 $__PARTITIONS_SUMMARY__ 信息
- python - 张量流:tf.reverse_sequence - seq_dim 和 batch_dim
- javascript - WebAssembly 实例:调用导出函数时的 Javascript 行为
- python - 无法在 Windows 上安装 python-Levenshtein,错误代码 1
- apache-spark - 在火花中优先分区/任务执行
- apache-spark - TensorflowOnSaprk 应用程序卡在 fit_generator() 后跟 predict_generator()
- c# - 将阿拉伯文本编码为十六进制格式