开发者社区> 问答> 正文

css 里面的 dt,dd 用完了这些标签还有样式没写咋办呢,可不可以在一个class里实现?

贴一段CSS代码:

<style type="text/css">
#info {height:450px;}
dl.bot_rgt {background:#7f7f9c url(img/c_tl.gif) top left no-repeat; margin:5px 0 0 50px; padding:0; float:left; margin-right:10px; width:40%; display:inline;}
dl.bot_rgt dt {background:transparent url(img/c_tr.gif) top right no-repeat; padding:10px; text-align:center; color:#fff;}
dl.bot_rgt dd {background:#eee url(img/c_bl.gif) bottom left no-repeat; padding:0; margin:0;}
dl.bot_lft {background:#7f7f9c url(img/c_tl.gif) top left no-repeat; margin:5px 0; padding:0; float:left; margin-right:10px; width:40%;}
dl.bot_lft dt {background:transparent url(img/c_tr.gif) top right no-repeat; padding:10px; text-align:center; color:#fff;}
dl.bot_lft dd {background:#eee url(img/c_br.gif) bottom right no-repeat; padding:0; margin:0;}
dl.top_rgt {background:#eee url(img/c_bl.gif) bottom left no-repeat; margin:5px 0 0 50px; padding:0; float:left; margin-right:10px; width:40%; display:inline;}
dl.top_rgt dt {background:#7f7f9c url(img/c_tl.gif) top left no-repeat; padding:10px; text-align:center; color:#fff;}
dl.top_rgt dd {background:transparent url(img/c_br.gif) bottom right no-repeat; padding:0; margin:0;}
dl.top_lft {background:#eee url(img/c_bl.gif) bottom left no-repeat; margin:5px 0; padding:0; float:left; margin-right:10px; width:40%;}
dl.top_lft dt {background:#7f7f9c url(img/c_tr.gif) top right no-repeat; padding:10px; text-align:center; color:#fff;}
dl.top_lft dd {background:transparent url(img/c_br.gif) bottom right no-repeat; padding:0; margin:0;}
dd p {margin:0; padding:10px; line-height:1.3em;}
</style>
里面的dl.bot_rgt是实现圆角的代码,可大家仔细看下,这里还差了一个脚,右下角的圆角没有实现的,而对应的“dl.top_lft dd {background:transparent url(img/c_br.gif) bottom right no-repeat; padding:0; margin:0;}”这个就实现了。

不知道dd,dt,这些东西该如何修改才能实现右下角这个圆角。是不是还要增加个其他的样式,比如dl之类的?

现在我不知道怎么在源代码里加入这个:

<div id="info">
<dl class="bot_rgt">
<dt>BOTTOM RIGHT SQUARE CORNER</dt>
<dd><p>This is the place to put your descriptive text. The three curved corners and one square corner box requires no extra markup, just a standard definition list with three background images.</p></dd>
</dl>

请知道的大哥大姐帮个忙了。。。

展开
收起
a123456678 2016-03-24 16:02:34 2287 0
1 条回答
写回答
取消 提交回答
  • 用css3的圆角实现非常简单

    把html代码改成
    
    <div id="info">
    这是圆角
    </div>
    把你的css代码全部删掉,然后替换成
    
    #info {
        border-radius: 5px;
        border:1px solid #ccc;
    }

    但是,ie9以下不支持这种效果

    2019-07-17 19:12:57
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载