Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3609960
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:41:35+00:00 2026-05-18T21:41:35+00:00

I am making an accordion using CSS, the below is my use of CSS

  • 0

I am making an accordion using CSS, the below is my use of CSS class without space. I use this to eliminate the animation of padding during slideDown and slideUp effect

.acc_container.block{
    padding: 20px; 
}

since it stated out that padding is 20 pixels but when i check it seems like no padding at all!!

instead, i need to add this in order to let my padding works

.acc_container. block{
    padding: 20px; 
}

(with space)

So what’s the difference between the class in CSS with and without a space?

This is all my HTML, jQuery with CSS code:

<html>
<head>
<style type="text/css">
body {
    font: 15px normal Arial, Helvetica, sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.7em;
}
.container {
    width: 500px;
    margin: 0 auto;
}
h2.acc_trigger {
    padding: 0;
    margin: 0 0 5px 0;
    background: url(h2_trigger_a.gif) no-repeat;
    height: 46px;
    line-height: 46px;
    width: 500px;
    font-size: 2em;
    font-weight: normal;
    float: left;
    display: block;
    padding: 0 0 0 50px;
    color: #fff;
    cursor: pointer;
}
h2.active {
    background-position: left bottom;
}
.acc_container {
    margin: 0 0 5px;
    padding: 0;
    overflow: hidden;
    font-size: 1.2em;
    width: 500px;
    clear: both;
    background: #f0f0f0;
    border: 1px solid #d6d6d6;
    -webkit-border-bottom-right-radius: 5px;
    -webkit-border-bottom-left-radius: 5px;
    -moz-border-radius-bottomright: 5px;
    -moz-border-radius-bottomleft: 5px;
    border-bottom-right-radius: 5px;
    border-bottom-left-radius: 5px;
}
.acc_container.block {
    padding: 20px;
}
.block {
    padding: 20px;
}
</style>
<script type="text/javascript" src="jquery.js"></script>
<script> type="text/javascript">

$(document).ready(function(){
       $('.acc_container').hide();    $('.acc_trigger:first').addClass('active').next().show();
       $('.acc_trigger').click(function(){
        if($(this).next().is(':hidden')) 
        {
           $('.acc_trigger').removeClass('active').next().slideUp();
     $(this).toggleClass('active').next().slideDown();
        }  

       return false;    });

});

</script>
</head>
<body>
<div class="container">
    <h2 class="acc_trigger">Web Design and Development</a></h2>
    <div class="acc_container">
        <div class="block">
            <h3>Need A website?</h3>
            <p>Consequat te olim letalis premo ad hos olim odio olim indoles ut 
            venio iusto. Euismod, sagaciter diam neque antehabeo blandit, jumentum 
            transverbero luptatum. Lenis vel diam praemitto molior facilisi facilisi 
            suscipere abico, ludus, at. Wisi suscipere nisl ad capto comis esse, 
            autem genitus. Feugiat immitto ullamcorper hos luptatum gilvus eum. 
            Delenit patria nunc os pneum acsi nulla magna singularis proprius autem 
            exerci accumsan.</p>
        </div>
    </div>
    <h2 class="acc_trigger">Logo/ Corporate Identity</h2>
    <div>
        class=&quot;acc_container&quot;&gt;
        <div class="block">
            <h3>Need a Logo?</h3>
            <p>Consequat te olim letalis premo ad hos olim odio olim indoles ut 
            venio iusto. Euismod, sagaciter diam neque antehabeo blandit, jumentum 
            transverbero luptatum. Lenis vel diam praemitto molior facilisi facilisi 
            suscipere abico, ludus, at. Wisi suscipere nisl ad capto comis esse, 
            autem genitus. Feugiat immitto ullamcorper hos luptatum gilvus eum. 
            Delenit patria nunc os pneum acsi nulla magna singularis proprius autem 
            exerci accumsan. </p>
            <p>Consequat te olim letalis premo ad hos olim odio olim indoles ut 
            venio iusto. Euismod, sagaciter diam neque antehabeo blandit, jumentum 
            transverbero luptatum. Lenis vel diam praemitto molior facilisi facilisi 
            suscipere abico, ludus, at. Wisi suscipere nisl ad capto comis esse, 
            autem genitus. Feugiat immitto ullamcorper hos luptatum gilvus eum. 
            Delenit patria nunc os pneum acsi nulla magna singularis proprius autem 
            exerci accumsan. </p>
        </div>
    </div>
    <h2 class="acc_trigger">Search Engine Optimization</a></h2>
    <div class="acc_container">
        <div class="block">
            <h3>Need to be heard</h3>
            <p>Consequat te olim letalis premo ad hos olim odio olim indoles ut 
            venio iusto. Euismod, sagaciter diam neque antehabeo blandit, jumentum 
            transverbero luptatum. Lenis vel diam praemitto molior facilisi facilisi 
            suscipere abico, ludus, at. Wisi suscipere nisl ad capto comis esse, 
            autem genitus. Feugiat immitto ullamcorper hos luptatum gilvus eum. 
            Delenit patria nunc os pneum acsi nulla magna singularis proprius autem 
            exerci accumsan.</p>
        </div>
    </div>
</div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:41:35+00:00Added an answer on May 18, 2026 at 9:41 pm

    .className. anotherClassName is invalid selector, so it will be ignored by browsers. Space itself () is a descendant selector.

    So you probably ask what’s the difference between .classA .classB and .classA.classB selectors.

    First selector will match any element with class classB that’s placed within element with class classA, eg.:

    <div class="classA">
      <p>
        Hello World!
        <span class="classB">this text will be matched by first selector</span>
        Lorem ipsum!
      </p>
    </div>
    

    Second selector will match any elements with both, classA and classB classes, eg.:

    <p class="classA">This won't be matched</p>
    <p class="classA classB classC classD">But this will be</p>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the jQuery UI 1.8 Accordion widget. When making use of the
I'm using eclipse Indigo and I'm making GUI, I've decided to use MigLayout cause
I have written a script using my local PHP 5.3 installation making use of
I'm making a accordion-type content section using mootools. Here's the HTML I'm working with:
When making a feedreader in Javascript (using google's feed API) I want to use
I'm making some pages using HTML, CSS, JavaScript and PHP. How much time should
I am making a media player using JMF, I want to use my own
I have a problem and can't find a solution. I am making an accordion
Making an adobe flex ui in which data that is calculated must use proprietary
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.