您的位置:

CSS颜色列表:完整的CSS颜色名称和HEX值

一、CSS颜色列表介绍

CSS颜色列表是在编写网页时使用的重要工具之一。随着网页设计的不断发展,对于颜色的需求也越来越多样化。CSS颜色列表提供了各种不同类型的颜色,满足了不同的需求。在CSS中,颜色可以通过CSS颜色名或HEX值来定义。

在CSS颜色列表中,颜色被分为了3类:命名颜色、系统颜色、十六进制颜色。

二、命名颜色

命名颜色是在CSS中预定义的一些颜色名称。共有147个颜色名称,它们是具有语义的,例如红色、绿色、黄色、蓝色等。这些颜色名称是在所有浏览器中都支持的,所以它们被广泛使用。

下面是一个命名颜色列表的示例代码:

<style>
    .red{
        color: red;
    }
    .blue{
        color: blue;
    }
    .green{
        color: green;
    }
</style>

<p class="red">这是一段红色的文本</p>
<p class="blue">这是一段蓝色的文本</p>
<p class="green">这是一段绿色的文本</p>

三、系统颜色

系统颜色是在操作系统中定义的颜色。这些颜色在不同的操作系统和设备上可能会不同,但在同一个系统内部,这些颜色是唯一的。

CSS支持16个系统颜色,它们都以Window 3.x系统的颜色名称来命名,例如ButtonFace、ActiveCaption等。

下面是一个系统颜色的代码示例:

<style>
    .button{
        background-color: ButtonFace;
        color: ButtonText;
    }
    .caption{
        background-color: ActiveCaption;
        color: CaptionText;
    }
</style>

<button class="button">这是一个使用系统颜色的按钮</button>
<h2 class="caption">这是一个使用系统颜色的标题</h2>

四、十六进制颜色

十六进制颜色是由6位十六进制数字组成的颜色值,每两位代表红、绿、蓝三原色的强度值。由于它们是数字,可以很方便地进行转换、计算和使用。

十六进制颜色可以通过#符号和6位十六进制数字来表示。例如,#FF0000表示红色,#00FF00表示绿色,#0000FF表示蓝色。在实际使用中,可以使用在线工具或者Photoshop等软件获取需要的十六进制颜色值。

下面是一个十六进制颜色的代码示例:

<style>
    .red{
        color: #FF0000;
    }
    .green{
        color: #00FF00;
    }
    .blue{
        color: #0000FF;
    }
</style>

<p class="red">这是一段红色的文本</p>
<p class="green">这是一段绿色的文本</p>
<p class="blue">这是一段蓝色的文本</p>

五、总结

CSS颜色列表是编写网页时必不可少的工具之一。在选择颜色时,我们可以根据自己的需求选择命名颜色、系统颜色或者十六进制颜色。通过这篇文章的介绍,相信大家对于CSS颜色列表有了更深入的了解和认识。

CSS颜色列表:完整的CSS颜色名称和HEX值

2023-05-12
CSS颜色代码

2023-05-12
CSS颜色值查找器

2023-05-12
CSS中的Hex颜色码是什么?

一、Hex颜色码的介绍 在前端开发中,颜色的选取是非常重要的一部分。CSS中提供了多种选取颜色的方式,其中Hex颜色码是最广泛使用的一种。Hex颜色码是指采用16进制(Hexadecimal)表示颜色

2023-12-08
CSS颜色转数字

2023-05-12
使用CSS hex值优化您的页面色彩

2023-05-12
CSS Hex Colors

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)