html - 如何使用自定义 wordpress 主题使 div 响应?

标签 html css wordpress responsive

我有一个正在使用的自定义 wordpress 主题,我正在编辑我的一个页面。我创建了 3 个 div,它们基本上应该在页面中心水平对齐。我想出了如何让一切正确对齐,但我需要它能够响应。当我从移动设备查看网页时,div 甚至没有完全显示在屏幕上并且没有滚动条。

请查看图片以了解它的外观。这三个 div 显示“查找答案、提交票证和与代理聊天”链接:
enter image description here

这是我创建这些 div 的代码:

<center>
<div style="width: 900px;">

<a href="http://neawebservices.com/client/knowledgebase.php" target="_blank"><div style="float: left; width: 200px; margin-right: 20px; border-radius: 25px; border: 2px solid #007ebf; padding: 20px; height: 150px; text-align: center;">
<h3 class="priceplanhr">Find Answers</h3>
<img class="alignnone wp-image-980 size-full" src="http://neawebservices.com/wp-content/uploads/2016/04/64-X-64.png" alt="" width="66" height="44" />

</div></a>

<a href="https://neawebservices.com/client/submitticket.php" target="_blank"><div style="float: left; width: 200px; margin-right: 20px; border-radius: 25px; border: 2px solid #007ebf; padding: 20px; height: 150px; text-align: center;">
<h3 class="priceplanhr">Submit a Ticket</h3>
<img class="alignnone wp-image-980 size-full" src="http://neawebservices.com/wp-content/uploads/2016/04/128-X-128-3.png" alt="" width="66" height="44" />

</div></a>

<a href="javascript:void(Tawk_API.toggle())"><div style="float: left; width: 200px; margin-right: 20px; border-radius: 25px; border: 2px solid #007ebf; padding: 20px; height: 150px; text-align: center;">
<h3 class="priceplanhr">Chat with an Agent</h3>
<img class="alignnone wp-image-980 size-full" src="http://neawebservices.com/wp-content/uploads/2016/04/64-X-64-1.png" alt="" width="55" height="55" />

</div></a>
</div>
</center>

主题使用外部 css,但如果我可以使用内联 css 获得相同的响应效果,那就太好了。

如果我能在这方面得到任何帮助,我将不胜感激!

最佳答案

CSS3 media queries是你的 friend 吗,不,他们不能在线完成。无论如何,通常最好不要使用内联 CSS。

您可以构建自己的媒体查询(请参阅 here )或将您的主题转换为 CSS 框架,例如 BootstrapFoundation (我个人更喜欢基金会)为你做。

关于html - 如何使用自定义 wordpress 主题使 div 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36707410/

相关文章:

css - 我可以使用位置 : fixed vertically and and position: absolute horizontally? 吗

css - Webpack:有没有办法在处理之前替换导入的文件路径?

javascript - 如何在滚动时让一个元素 div 移动而另一个不移动?

javascript - HTML5 Canvas 垂直翻转功能在 Firefox 中有效,但在 Chrome 或 Safari 中无效。为什么?

php - 如何在创建 wordpress 主题时包含 css 文件?

html - CSS "Display:None"在我的投资组合页面上留下空间

php - WordPress 创建新帖子时保存翻译帖子

html - 错误显示下拉菜单(移动)bootstrap

html - 我的下拉菜单不起作用

php - 已阻止保存帖子