CSS 日常练习----堆叠上下文练习 发表于 2018-06-09 | 分类于 技术 , Blog记录日常 CSS 练习的小知识点 —— 堆叠上下文练习堆叠上下文练习点击预览123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>圆角</title> <style> div.test{ width: 300px; height: 300px; border-width:20px 40px; border-color: red; border-style: solid; margin: 20px auto; border-top-left-radius: 100px; } .test1{ width: 300px; height: 300px; border-width:20px 40px; border-color: red; border-style: solid; margin: 20px auto; border-top-left-radius: 40px; } .test2{ width: 300px; height: 200px; border:20px red solid; margin: 20px auto; /*border-radius: 150px 0 0 150px/150px 0 0 150px;*/ border-radius: 150px 0 0 150px; /*border-radius: 50% 0 0 50%/50% 0 0 50%;*/ } .test3{ width: 300px; height: 200px; border:20px red solid; margin: 20px auto; /*border-radius: 50% 50% 0 0/100% 100% 0 0;*/ /*简化:*/ border-radius: 50%/100% 100% 0 0; } div.test4{ width: 300px; height: 200px; border:20px red solid; margin: 20px auto; border-radius: 100% 0 0 0; } </style></head><body><div class="test">边框和内外径</div><div class="test1">边框和内外径</div><div class="test2">椭圆:</div><div class="test3">半椭圆</div><div class="test4">四分之一椭圆</div></body></html>本文作者: bobo本文链接: https://www.anynote.me/3947594243.html版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!