任何方式来声明一个大小/部分边框到一个盒子? [英] Any way to declare a size/partial border to a box?

查看:104
本文介绍了任何方式来声明一个大小/部分边框到一个盒子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以任何方式声明一个大小/部分边框到css3中的框?例如,一个350像素的框,其首部60像素只显示边框底部。我认为这可能非常有用。

Any way to declare a size/partial border to a box in css3? For example a box with 350px that only shows a border-bottom in its firsts 60px. I think that might be very useful.

示例:


推荐答案

不是真的。但是很容易以一种优雅的方式实现效果,并且不需要多余的标记:

Not really. But it's very easy to achieve the effect in a way that degrades gracefully and requires no superfluous markup:

div {
  width:350px; 
  height:100px; 
  background:lightgray; 
  position:relative;
 }
div:after {
  content:''; 
  width:60px; 
  height:4px; 
  background:gray; 
  position:absolute; 
  bottom:-4px;
}

演示

这篇关于任何方式来声明一个大小/部分边框到一个盒子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆