Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSS - 边角(非 border-radius) #3

Open
threetown opened this issue Jul 31, 2018 · 0 comments
Open

CSS - 边角(非 border-radius) #3

threetown opened this issue Jul 31, 2018 · 0 comments

Comments

@threetown
Copy link
Owner

threetown commented Jul 31, 2018

1. 参考

2. 效果图

image

  • HTML

    gxd/index.html

    Lines 23 to 24 in 1061d1c

    <div class="right_content commonBd hasBorderStyle">
    <span></span><span></span><span></span><span></span>

  • CSS

    .hasBorderStyle{position: relative;}
    .hasBorderStyle>span{
    position: absolute;
    padding: .05rem;
    z-index: 2;
    border-style: solid;
    border-color: #104062;
    }
    .hasBorderStyle>span:nth-child(1),
    .hasBorderStyle>span:nth-child(2){
    top: -1px;
    }
    .hasBorderStyle>span:nth-child(1),
    .hasBorderStyle>span:nth-child(4){
    left: -1px;
    }
    .hasBorderStyle>span:nth-child(2),
    .hasBorderStyle>span:nth-child(3){
    right: -1px;
    }
    .hasBorderStyle>span:nth-child(3),
    .hasBorderStyle>span:nth-child(4){
    bottom: -1px;
    }
    .hasBorderStyle>span:nth-child(1){
    border-width: 2px 0 0 2px;
    }
    .hasBorderStyle>span:nth-child(2){
    border-width: 2px 2px 0 0;
    }
    .hasBorderStyle>span:nth-child(3){
    border-width: 0 2px 2px 0;
    }
    .hasBorderStyle>span:nth-child(4){
    border-width: 0 0 2px 2px;
    }

@threetown threetown changed the title CSS - 四角 CSS - 边角(非 border-radius) Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant