zoukankan      html  css  js  c++  java
  • 解决ie7不支持after、before的方法

    1、第一个步骤http://jquery.lukelutman.com/plugins/pseudo/ 下载 jq-pseudo.js
    下载好了,就引入jQuery和jq-pseudo.js
    2、书写选择器的语法:
    选择器:before, 选择器 {
      /*兼容IE6、IE7*/
       before: '要写的内容';
       /*兼容IE8*/
       content: '要写的内容';
    }
    对伪元素进行设置样式:
    选择器:before, 选择器 .before {
             书写样式       
    }
     
    demo:
     1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     2 <html>
     3     <head>
     4         <title>Basic Example - jQuery Pseudo Plugin</title>
     5         <script type="text/javascript" src="jquery.js"></script>
     6         <script type="text/javascript" src="jquery.pseudo.js"></script>
     7         <script type="text/javascript">
     8             $(function(){
     9                 $('#on').bind('click', function(e){
    10                     $('body').addClass('toggle');
    11                     e.preventDefault();
    12                 });
    13                 $('#off').bind('click', function(e){
    14                     $('body').removeClass('toggle');
    15                     e.preventDefault();
    16                 });
    17             });
    18         </script>
    19         <style type="text/css">
    20     
    21             p:before, p {
    22                 before: 'foo ';
    23                 content: 'foo '; }
    24                 
    25             p:after, p {
    26                 after: ' bar';
    27                 content: ' bar'; }
    28         
    29             p:before, p .before {
    30                 color: blue; }
    31                 
    32             p:after, p .after {
    33                 color: red; }
    34         
    35         </style>
    36     </head>
    37     <body>
    38         <h1>Basic Example - jQuery Pseudo Plugin</h1>
    39         <p>&laquo; <a href="index.html">Back to the jQuery Pseudo Plugin</a></p>
    40         <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    41         <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    42         <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
    43     </body>
    44 </html>
  • 相关阅读:
    Cannot change network to bridged: There are no un-bridged host network adapters解决方法
    The authenticity of host 192.168.0.xxx can't be established.
    Vm下 linux与windowsxp文件共享的方法
    vmware 下的linux的host only上网配置
    VMWare三种工作模式 :bridge、host-only、nat
    云技术入门指导:什么是云计算技术,云技术用什么语言开发
    什么是移动云计算
    云计算是什么
    架构之路
    这首诗看着是越看越顺眼,百赋乐其中
  • 原文地址:https://www.cnblogs.com/front-end-develop/p/5754213.html
Copyright © 2011-2022 走看看