小编Cod*_*016的帖子

浏览器中的 CSS 错误:使用伪时“未知属性名称”:after

尝试设置伪 .css 的 css 属性时,我在 Chrome 和资源管理器中收到以下错误:after(我正在尝试设置一个汉堡导航图标并为其设置样式)

我收到错误:

'未知的属性名称'

当我设置widthheightbackground等伪:after。这是在 Chrome 中:

在此处输入图片说明

给我错误的代码:

nav a#pull:after {
 content:"";
 background: url('nav-icon.png') no-repeat;
 width: 30px;
 height: 30px;
 display: inline-block;
 position: absolute;
 right: 15px;
 top: 10px;
Run Code Online (Sandbox Code Playgroud)

完整的 HTML 代码

<html>
  <head>
    <title>Delivery Motion!</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" type="text/css" href="css/style.css">
    <script src="js/jquery-3.0.0.min.js"></script>
    <script>

    window.onload = function() {
    if (window.jQuery) {
        // jQuery is loaded
        alert("Yeah!");
    } else {
        // jQuery is …
Run Code Online (Sandbox Code Playgroud)

html javascript css

7
推荐指数
1
解决办法
3万
查看次数

标签 统计

css ×1

html ×1

javascript ×1