会员可以在此提问,百战程序员老师有问必答
对大家有帮助的问答会被标记为“推荐”
看完课程过来浏览一下别人提的问题,会帮你学得更全面
截止目前,同学们一共提了 132376个问题
Python 全系列/第二阶段:Python 深入与提高/游戏开发-坦克大战 3093楼

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 后代选择器,所有后代,包括子代和孙代都适用 */
        ul li {
            color: red;
            list-style-type: circle;
        }
       /* 子代选择器,仅适用于直接子代,对子代的子代不适用 */
        div>a {
            color:red;
        }
        ol>li{
            color:#ff00ff;
        }
    </style>
</head>

<body>
    <ul>
        <li>列表1</li>
        <li>
            <ul>
                <li>孙子1</li>
                <li>孙子2</li>
                <li>孙子3</li>
            </ul>
        </li>
        <li>列表3</li>
    </ul>

    <div>
        <a href="#">我是儿子A标签</a>
        <p>
            <a href="#">我是孙子A标签</a>
        </p>
    </div>

    <ol>
        <li>我是儿子li标签</li>
        <p>
            <li>我是孙子li标签</li>
        </p>
    </ol>
</body>

</html>

老师帮忙看看最后一个ol标签,为什么子代选择器对嵌套的li标签还是起作用了

Python 全系列/第七阶段:网页编程基础/CSS3 3094楼


屏幕截图 2023-01-06 112743.png

这个不生效,不解压拖进去报错

WEB前端全系列/第二阶段:JavaScript编程模块/编程风格 3096楼
JAVA 全系列/第三阶段:数据库编程/Oracle 数据库的使用 3097楼
JAVA 全系列/第二阶段:JAVA 基础深化和提高/多线程技术 3099楼

老师,我根据老师的配置复制到IDE 里面显示报错。是 我少了什么文件吗

classpath:applicationContext-*.xml

springmvc.xml
 
 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd"
         version="4.0">
    <!-- 上下文参数,告诉Spring配置文件路径 -->
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath:applicationContext-*.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <!-- 配置springmvc -->
    <servlet>
        <servlet-name>springmvc</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>classpath:springmvc.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>springmvc</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

    <filter>
        <filter-name>encoding</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>utf-8</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encoding</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <welcome-file-list>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
        <welcome-file>default.html</welcome-file>
        <welcome-file>default.htm</welcome-file>
        <welcome-file>default.jsp</welcome-file>
    </welcome-file-list>
</web-app>

image.png

JAVA 全系列/第六阶段:项目管理与SSM框架/RBAC实战 3105楼

课程分类

百战程序员微信公众号

百战程序员微信小程序

©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园
网站维护:百战汇智(北京)科技有限公司
京公网安备 11011402011233号    京ICP备18060230号-3    营业执照    经营许可证:京B2-20212637