您的位置:

CSS HTML Border Rounded

一、圆角边框

圆角边框是CSS中一种常见的效果,它可以为HTML元素的边框添加圆角。通过使用border-radius属性,我们可以为元素的四个角分别设置圆角半径。

    
        /* 给元素添加圆角边框 */
        border-radius: 10px;
        /* 分别为元素的四个角设置圆角半径 */
        border-radius: 10px 20px 30px 40px;
    

其中,第一个值对应左上角,顺时针方向分别对应右上角、右下角和左下角的圆角半径。我们也可以通过使用border-top-left-radius、border-top-right-radius、border-bottom-right-radius、border-bottom-left-radius来单独设置元素角的圆角半径。

二、透明度

通过设置CSS的opacity属性,可以为HTML元素添加透明效果,取值范围为0~1,其中0表示完全透明,1表示不透明。

    
        /* 设置元素透明度为50% */
        opacity: 0.5;
    

需要注意的是,透明度会同时影响元素及其子元素。如果需要为子元素单独设置透明度,可以使用rgba颜色值,其中a表示透明度,取值范围同样为0~1。

    
        /* 设置背景颜色为红色,透明度为50% */
        background-color: rgba(255, 0, 0, 0.5);
    

三、阴影效果

通过使用CSS的box-shadow属性,可以为HTML元素添加阴影效果。

    
        /* 添加一个水平偏移量为10px,垂直偏移量为10px,模糊半径为5px,颜色为黑色的阴影效果 */
        box-shadow: 10px 10px 5px #000;
    

box-shadow属性接受多个值,用逗号分隔。第一个值为水平偏移量,第二个值为垂直偏移量,第三个值为模糊半径,第四个值为阴影颜色。

四、边框图像

边框图像是一种特殊的边框效果,可以为HTML元素的边框添加复杂的背景图像。

    
        /* 设置元素边框为10px的圆角边框,边框图像为radial-gradient */
        border-radius: 10px;
        border-image: radial-gradient(circle at top left, #00f, #0f0, #f00) 1;
    

其中,radial-gradient是一个径向渐变的背景图像,circle at top left表示渐变从左上角开始,#00f、#0f0和#f00分别为渐变的起始、中间和结束颜色。1表示边框图像的宽度,可以根据需要调整。

五、圆角图片

通过使用CSS的border-radius属性,可以为HTML元素添加圆角边框,同样的,我们也可以将这种效果应用到图片上,实现圆角图片的效果。

    
        /* 设置图片显示为圆形 */
        border-radius: 50%;
    

其中,50%表示圆形的半径,可以根据需要调整。需要注意的是,应用border-radius属性后,图片的位置可能会发生改变,可以通过设置position、top和left属性来调整图片的位置。

CSS Border Rounded

2023-05-12
CSS HTML Border Rounded

2023-05-12
CSS Border in HTML

2023-05-12
CSS圆角矩形详解

2023-05-18
CSS HTML Border

2023-05-12
CSS HTML DIV Border标题

2023-05-12
CSS HTML Border Color

2023-05-12
如何使用CSS创建圆角边框效果

2023-05-12
when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: ${item.id} [in template "article/detail/index.ftl" at line 48, column 106] ---- Java stack trace (for programmers): ---- freemarker.core.InvalidReferenceException: [... Exception message was already printed; see it above ...] at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134) at freemarker.core.EvalUtil.coerceModelToTextualCommon(EvalUtil.java:481) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:401) at freemarker.core.EvalUtil.coerceModelToStringOrMarkup(EvalUtil.java:370) at freemarker.core.DollarVariable.calculateInterpolatedStringOrMarkup(DollarVariable.java:104) at freemarker.core.DollarVariable.accept(DollarVariable.java:63) at freemarker.core.Environment.visit(Environment.java:371) at freemarker.core.IteratorBlock$IterationContext.executedNestedContentForCollOrSeqListing(IteratorBlock.java:321) at freemarker.core.IteratorBlock$IterationContext.executeNestedContent(IteratorBlock.java:271) at freemarker.core.IteratorBlock$IterationContext.accept(IteratorBlock.java:244) at freemarker.core.Environment.visitIteratorBlock(Environment.java:645) at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:108) at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94) at freemarker.core.Environment.visit(Environment.java:335) at freemarker.core.Environment.visit(Environment.java:341) at freemarker.core.Environment.visit(Environment.java:341) at freemarker.core.Environment.process(Environment.java:314) at freemarker.template.Template.process(Template.java:383) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.processTemplate(FreeMarkerView.java:332) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.doRender(FreeMarkerView.java:266) at org.springframework.web.servlet.view.freemarker.FreeMarkerView.renderMergedTemplateModel(FreeMarkerView.java:220) at org.springframework.web.servlet.view.AbstractTemplateView.renderMergedOutputModel(AbstractTemplateView.java:181) at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:314) at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1431) at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1167) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1106) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:979) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1014) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:903) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:564) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:885) at jakarta.servlet.http.HttpServlet.service(HttpServlet.java:658) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:205) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at com.software.filter.HttpSpiderIdentifyFilter.doFilter(HttpSpiderIdentifyFilter.java:51) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:116) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:174) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:149) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:482) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:115) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:340) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:391) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:896) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1744) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) at java.base/java.lang.VirtualThread.run(VirtualThread.java:309)