sliding door 滑动门 总结

本文详细介绍了网页设计中的一种特殊技巧——滑动门技术。该技术通过使用不同数量的嵌套div来创建平滑的边角效果。文章提供了两种方法的具体实现细节:两门法与三门法,并给出了关键的CSS属性设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

之前一直听说sliding door/滑动门,很多人也讨论过。今天突然有点忘了,为了加深印象,总结了其中的精华,同时也贡献给大家:

 

以tab作为实例,分为2门和3门两种方法:

 

 

sliding door 滑动门

 

source:

http://www.alistapart.com/articles/slidingdoors/

 

example:

http://www.alistapart.com/d/slidingdoors/v1/ex4.html

 

two doors method

 

two nested div

<li>

<a href="#">

Home

</a>

</li>

keypoints:

1. a

background image with the whole cruve

will have a max width because of background with

background position right

padding left x-l and right x

2. li

background image with just rounded corner (width is l)

background position left

padding left 

this method can have a Symmetrical method by switching left to right

 

three doors method

 

three nested div

<li>

<a href="#">

<div>Home</div>

</a>

</li>

keypoints:

 

1. first div 

background image with the just right corner

fixed width l

background position right

padding right l

2. second div

background image with just left corner

width l

background position left

padding left l

3. third div

background image with middle part of the original image (without corners)

no fixed width

repeat

padding 0

 

 

可惜不能上传例子,有需要的问我要啊。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值