【问题标题】:Add rounded corner div in wordpress blog post在 wordpress 博客文章中添加圆角 div
【发布时间】:2021-06-14 11:30:14
【问题描述】:

我正在尝试创建一个类似链接中的博客:http://www.wikihow.com/Grow-Flowers-from-Seed

每个步骤都有单独的部分,圆角,不同的背景颜色和中心对齐。

到目前为止,我在 wordpress 中写的是:

<div style="width: 90%; background-color: #eaeaea;">
     <a href="http://prelaunch.biocarve.com/blog/wp-content/uploads/2015/12/670px-Grow-Flowers-from-Seed-Step-1.jpg"><img class=" size-medium wp-image-258 aligncenter" src="http://prelaunch.biocarve.com/blog/wp-content/uploads/2015/12/670px-Grow-Flowers-from-Seed-Step-1-300x225.jpg" alt="Grow Flowers From Seeds step1" width="450" /></a>
    <div style="width: 5%; padding: 0 10pt 0 0; float: left; background-color: #eaeaea;">
        <b>1</b>
    </div>
    <div class="step" style="width: 95%; padding: 0 10pt 0 0; float: left; background-color: #eaeaea;">
        <b class="whb">Choose a container.</b> There are a variety of inexpensive options available. Germinating flats are cheap and specifically created for the purpose of germinating seeds. Plastic drinking cups and recycled egg cartons are other inexpensive options, however. Small flower pots will also work.
    </div>
</div>

现在我得到的看起来像: 请让我知道我哪里错了,我怎么能有圆角。

【问题讨论】:

  • 你也可以试试边框样式?
  • 我的第一条评论的补充——学习使用浏览器开发者工具。如果您检查过该元素,您会看到 border-radiusborder 用于设置该容器的样式。因此,仅出于测试目的,请使用&lt;div style="width: 90%; background-color: #eaeaea; border: 1px solid black; border-radius: 4px;"&gt;
  • 谢谢,有边界半径就行了!!

标签: html wordpress rounded-corners


【解决方案1】:

只需添加这个类并将该类传递给给 &lt;div&gt; 以将图像遮盖一个圆角

.roundedCorner{ 

  -webkit-border-radius: 50px;
  -moz-border-radius: 50px;
  border-radius: 50px;

}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-05-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多