zoukankan      html  css  js  c++  java
  • [CSS3] Target HTML Elements not Explicitly set in the DOM with CSS Pseudo Elements (Blockquotes)

    Pseudo elements allow us to target elements that are not explicitly set in the DOM. Using ::before ::after we can actually create and manipulate elements in the DOM that do not impact the content. While ::first-letter ::first-line ::selection ::placeholder allow us to target elements that do not have a specific DOM element.

     About 'blockquote':
    blockquote {
      quotes: "“" "”" "‘" "’";
    }
    
    blockquote::before {
      content: open-quote;
    }
    blockquote::after {
      content: close-quote;
    }

    About ::first-line, ::first-letter:

    p::first-line {
      color: green;
    }
    
    p::first-letter {
      font-size: 2em;
      float: left;
      line-height: 1.7em;
      padding: 0 .3em;
      font-weight: bold;
    }
    <div style="350px; margin: 0 auto; padding-top: 80px; padding-bottom: 80px;"> 
        
        <div class="testimonial-quote ">
            <div class="quote-container">
                <blockquote>
                    <p>Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! I'd recommend them to anyone looking for a creative, thoughtful, and professional team. Overall, fantastic! </p>
                </blockquote>  
                <cite><span>Kristi Bruno</span></cite>
            </div>
        </div>   
    
    </div>
    
    
    
    .testimonial-quote {
        font-size: 14px;
    }
    
    .testimonial-quote blockquote {
        /* Negate theme styles */
        border: 0;
        margin: 0;
        padding: 0;
    
        background: none;
        color: gray;
        font-family: Georgia, serif;
        font-size: 1.25em;
        font-style: italic;
        line-height: 1.4 !important;
        margin: 0;
        position: relative;
        text-shadow: 0 1px white;
        z-index: 600;
    }
    
    .testimonial-quote blockquote * {
        box-sizing: border-box; 
    }
    
    .testimonial-quote blockquote p {
        color: #75808a; 
        line-height: 1.2 !important;
    }
    
    .testimonial-quote blockquote p:first-child:before {
        content: '201C';
        color: #81bedb;
        font-size: 6em;
        font-weight: 700;
        opacity: .3;
        position: absolute;
        top: -.4em;
        left: -.2em;    
        text-shadow: none;
        z-index: -300;
    }
    
    .testimonial-quote cite {
        color: gray;
        display: block;
        font-size: .8em; 
    }
      
    .testimonial-quote cite span {
        color: #5e5e5e;
        font-size: 1em;
        font-style: normal;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        text-shadow: 0 1px white; 
    }
    
    .testimonial-quote {
        position: relative; 
    }
    
    .testimonial-quote cite {
        text-align: right; 
    }
    img {
      background-color: red;
    }

  • 相关阅读:
    没了解这些,测试人也要为降薪做好准备!
    测试之巅—自动化测试!
    自动化测试现状趋势解读,附带近年自动化测试常用工具
    技术大佬:如何最快速度上手接口测试?(一篇文章搞定)
    三个Python自动化测试高效工具的使用总结
    Postman接口测试实战分享,这5个问题你必须得知道!【软件测试工程师经验分享】
    Python实现性能自动化测试的方法【推荐好文】
    md5加密
    python操作数据库
    time模块:时间戳和格式化好的时间表示方法及互相转换方法
  • 原文地址:https://www.cnblogs.com/Answer1215/p/10068269.html
Copyright © 2011-2022 走看看