Target a css class inside another css class

后端 未结 2 423
面向向阳花
面向向阳花 2021-02-01 11:26

Hi I am having problems with some css classes in joomla. I have two divs in a module, one is the wrapper class=\"wrapper\", the other is the content class=\"content\" . Content

相关标签:
2条回答
  • 2021-02-01 12:06

    Not certain what the HTML looks like (that would help with answers). If it's

    <div class="testimonials content">stuff</div>

    then simply remove the space in your css. A la...

    .testimonials.content { css here }

    UPDATE:

    Okay, after seeing HTML see if this works...

    .testimonials .wrapper .content { css here }
    

    or just

    .testimonials .wrapper { css here }
    

    or

    .desc-container .wrapper { css here }
    

    all 3 should work.

    0 讨论(0)
  • 2021-02-01 12:11

    I use div instead of tables and am able to target classes within the main class, as below:

    CSS

    .main {
        .width: 800px;
        .margin: 0 auto;
        .text-align: center;
    }
    .main .table {
        width: 80%;
    }
    .main .row {
       / ***something ***/
    }
    .main .column {
        font-size: 14px;
        display: inline-block;
    }
    .main .left {
        width: 140px;
        margin-right: 5px;
        font-size: 12px;
    }
    .main .right {
        width: auto;
        margin-right: 20px;
        color: #fff;
        font-size: 13px;
        font-weight: normal;
    }
    

    HTML

    <div class="main">
        <div class="table">
            <div class="row">
                <div class="column left">Swing Over Bed</div>
                <div class="column right">650mm</div>
                <div class="column left">Swing In Gap</div>
                <div class="column right">800mm</div>
            </div>
        </div>
    </div>
    

    If you want to style a particular "cell" exclusively you can use another sub-class or the id of the div e.g:

    .main #red { color: red; }

    <div class="main">
        <div class="table">
            <div class="row">
                <div id="red" class="column left">Swing Over Bed</div>
                <div class="column right">650mm</div>
                <div class="column left">Swing In Gap</div>
                <div class="column right">800mm</div>
            </div>
        </div>
    </div>
    
    0 讨论(0)
提交回复
热议问题