CSS/SASS Select elements based on class, but exclude certain elements with same classWhich characters are valid in CSS class names/selectors?How can I select an element by name with jQuery?How to style a <select> dropdown with only CSS?Remove CSS class from element with JavaScript (no jQuery)How do I combine a background-image and CSS3 gradient on the same element?CSS selector for first element with classHow can I set the default value for an HTML <select> element?Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQueryCan I write a CSS selector selecting elements NOT having a certain class?Sass Variable in CSS calc() function

Checking @@ROWCOUNT failing

Writing in a Christian voice

Air travel with refrigerated insulin

When is the exact date for EOL of Ubuntu 14.04 LTS?

Error in master's thesis, I do not know what to do

Capacitor electron flow

How to preserve electronics (computers, ipads, phones) for hundreds of years?

Do I have to take mana from my deck or hand when tapping this card?

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

I keep switching characters, how do I stop?

Can you take a "free object interaction" while incapacitated?

Would this string work as string?

"Marked down as someone wanting to sell shares." What does that mean?

Should a narrator ever describe things based on a character's view instead of facts?

How can a new country break out from a developed country without war?

Index matching algorithm without hash-based data structures?

What is this high flying aircraft over Pennsylvania?

Turning a hard to access nut?

What (if any) is the reason to buy in small local stores?

Walter Rudin's mathematical analysis: theorem 2.43. Why proof can't work under the perfect set is uncountable.

How do I prevent inappropriate ads from appearing in my game?

Derivative of an interpolated function

How to test the sharpness of a knife?

A seasonal riddle



CSS/SASS Select elements based on class, but exclude certain elements with same class


Which characters are valid in CSS class names/selectors?How can I select an element by name with jQuery?How to style a <select> dropdown with only CSS?Remove CSS class from element with JavaScript (no jQuery)How do I combine a background-image and CSS3 gradient on the same element?CSS selector for first element with classHow can I set the default value for an HTML <select> element?Selecting and manipulating CSS pseudo-elements such as ::before and ::after using jQueryCan I write a CSS selector selecting elements NOT having a certain class?Sass Variable in CSS calc() function













2















I am going to slap myself once an answer comes in... so what I am trying to do is add a border to all elements with <anyElement class="required active">, but not to <select class="required active">. Difference being the <select> element.



Example tried lol:



.required.active, :not(select.required.active) 
border: 1px solid red;



Using CSS3 and/or SASS.



Thanks!










share|improve this question


























    2















    I am going to slap myself once an answer comes in... so what I am trying to do is add a border to all elements with <anyElement class="required active">, but not to <select class="required active">. Difference being the <select> element.



    Example tried lol:



    .required.active, :not(select.required.active) 
    border: 1px solid red;



    Using CSS3 and/or SASS.



    Thanks!










    share|improve this question
























      2












      2








      2








      I am going to slap myself once an answer comes in... so what I am trying to do is add a border to all elements with <anyElement class="required active">, but not to <select class="required active">. Difference being the <select> element.



      Example tried lol:



      .required.active, :not(select.required.active) 
      border: 1px solid red;



      Using CSS3 and/or SASS.



      Thanks!










      share|improve this question














      I am going to slap myself once an answer comes in... so what I am trying to do is add a border to all elements with <anyElement class="required active">, but not to <select class="required active">. Difference being the <select> element.



      Example tried lol:



      .required.active, :not(select.required.active) 
      border: 1px solid red;



      Using CSS3 and/or SASS.



      Thanks!







      html css css3 sass






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 7 at 1:19









      RooksStrifeRooksStrife

      6362732




      6362732






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Maybe this is what you're looking for.



          As i've understood on your post, you only need to exclude < select > tags with "required" and "active" classes.






          :not(select).required.active 
          border: 1px solid red;

          <div class="required active">
          qwe
          </div>
          <p class="required active">
          qwe
          </p>
          <input type="text" class="required active" value="qwe">
          <select class="required active">
          <option value="1">qwe</option>
          </select>





          In this snippet, we used the :not() selector of CSS3 to eliminate the <select> tag with "required" and "active" classes.



          For further explanation about the :not() CSS Selector, please refer to these links:



          Dev. Mozilla Org: (CSS :not() Selector)



          W3Schools.COM: (CSS :not() Selector)






          share|improve this answer

























          • Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

            – RooksStrife
            Mar 7 at 18:52












          • Happy coding @RooksStrife! :)

            – The Terrible Child
            Mar 8 at 1:23



















          2














          What you are looking can be achieved through this:
          CSS:






          .required.active:not(select).required.active{
          border: 1px solid red;
          color:blue

          <!DOCTYPE html>
          <html>
          <head></head>
          <body>
          <p class="required active">Hello</p>
          <p class="required active">Hello</p>
          <p>Hello</p>
          <select class="required active">
          <option>Hello<option>
          </select>
          </body>
          </html>





          let me know if you need any other help.






          share|improve this answer
























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034627%2fcss-sass-select-elements-based-on-class-but-exclude-certain-elements-with-same%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Maybe this is what you're looking for.



            As i've understood on your post, you only need to exclude < select > tags with "required" and "active" classes.






            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>





            In this snippet, we used the :not() selector of CSS3 to eliminate the <select> tag with "required" and "active" classes.



            For further explanation about the :not() CSS Selector, please refer to these links:



            Dev. Mozilla Org: (CSS :not() Selector)



            W3Schools.COM: (CSS :not() Selector)






            share|improve this answer

























            • Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

              – RooksStrife
              Mar 7 at 18:52












            • Happy coding @RooksStrife! :)

              – The Terrible Child
              Mar 8 at 1:23
















            1














            Maybe this is what you're looking for.



            As i've understood on your post, you only need to exclude < select > tags with "required" and "active" classes.






            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>





            In this snippet, we used the :not() selector of CSS3 to eliminate the <select> tag with "required" and "active" classes.



            For further explanation about the :not() CSS Selector, please refer to these links:



            Dev. Mozilla Org: (CSS :not() Selector)



            W3Schools.COM: (CSS :not() Selector)






            share|improve this answer

























            • Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

              – RooksStrife
              Mar 7 at 18:52












            • Happy coding @RooksStrife! :)

              – The Terrible Child
              Mar 8 at 1:23














            1












            1








            1







            Maybe this is what you're looking for.



            As i've understood on your post, you only need to exclude < select > tags with "required" and "active" classes.






            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>





            In this snippet, we used the :not() selector of CSS3 to eliminate the <select> tag with "required" and "active" classes.



            For further explanation about the :not() CSS Selector, please refer to these links:



            Dev. Mozilla Org: (CSS :not() Selector)



            W3Schools.COM: (CSS :not() Selector)






            share|improve this answer















            Maybe this is what you're looking for.



            As i've understood on your post, you only need to exclude < select > tags with "required" and "active" classes.






            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>





            In this snippet, we used the :not() selector of CSS3 to eliminate the <select> tag with "required" and "active" classes.



            For further explanation about the :not() CSS Selector, please refer to these links:



            Dev. Mozilla Org: (CSS :not() Selector)



            W3Schools.COM: (CSS :not() Selector)






            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>





            :not(select).required.active 
            border: 1px solid red;

            <div class="required active">
            qwe
            </div>
            <p class="required active">
            qwe
            </p>
            <input type="text" class="required active" value="qwe">
            <select class="required active">
            <option value="1">qwe</option>
            </select>






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 12 at 20:31









            Mr Lister

            35.3k1077121




            35.3k1077121










            answered Mar 7 at 1:42









            The Terrible ChildThe Terrible Child

            1036




            1036












            • Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

              – RooksStrife
              Mar 7 at 18:52












            • Happy coding @RooksStrife! :)

              – The Terrible Child
              Mar 8 at 1:23


















            • Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

              – RooksStrife
              Mar 7 at 18:52












            • Happy coding @RooksStrife! :)

              – The Terrible Child
              Mar 8 at 1:23

















            Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

            – RooksStrife
            Mar 7 at 18:52






            Perfect - avoids the select tags, but borders all others with the classes. All done in the least amount of code!

            – RooksStrife
            Mar 7 at 18:52














            Happy coding @RooksStrife! :)

            – The Terrible Child
            Mar 8 at 1:23






            Happy coding @RooksStrife! :)

            – The Terrible Child
            Mar 8 at 1:23














            2














            What you are looking can be achieved through this:
            CSS:






            .required.active:not(select).required.active{
            border: 1px solid red;
            color:blue

            <!DOCTYPE html>
            <html>
            <head></head>
            <body>
            <p class="required active">Hello</p>
            <p class="required active">Hello</p>
            <p>Hello</p>
            <select class="required active">
            <option>Hello<option>
            </select>
            </body>
            </html>





            let me know if you need any other help.






            share|improve this answer





























              2














              What you are looking can be achieved through this:
              CSS:






              .required.active:not(select).required.active{
              border: 1px solid red;
              color:blue

              <!DOCTYPE html>
              <html>
              <head></head>
              <body>
              <p class="required active">Hello</p>
              <p class="required active">Hello</p>
              <p>Hello</p>
              <select class="required active">
              <option>Hello<option>
              </select>
              </body>
              </html>





              let me know if you need any other help.






              share|improve this answer



























                2












                2








                2







                What you are looking can be achieved through this:
                CSS:






                .required.active:not(select).required.active{
                border: 1px solid red;
                color:blue

                <!DOCTYPE html>
                <html>
                <head></head>
                <body>
                <p class="required active">Hello</p>
                <p class="required active">Hello</p>
                <p>Hello</p>
                <select class="required active">
                <option>Hello<option>
                </select>
                </body>
                </html>





                let me know if you need any other help.






                share|improve this answer















                What you are looking can be achieved through this:
                CSS:






                .required.active:not(select).required.active{
                border: 1px solid red;
                color:blue

                <!DOCTYPE html>
                <html>
                <head></head>
                <body>
                <p class="required active">Hello</p>
                <p class="required active">Hello</p>
                <p>Hello</p>
                <select class="required active">
                <option>Hello<option>
                </select>
                </body>
                </html>





                let me know if you need any other help.






                .required.active:not(select).required.active{
                border: 1px solid red;
                color:blue

                <!DOCTYPE html>
                <html>
                <head></head>
                <body>
                <p class="required active">Hello</p>
                <p class="required active">Hello</p>
                <p>Hello</p>
                <select class="required active">
                <option>Hello<option>
                </select>
                </body>
                </html>





                .required.active:not(select).required.active{
                border: 1px solid red;
                color:blue

                <!DOCTYPE html>
                <html>
                <head></head>
                <body>
                <p class="required active">Hello</p>
                <p class="required active">Hello</p>
                <p>Hello</p>
                <select class="required active">
                <option>Hello<option>
                </select>
                </body>
                </html>






                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Mar 7 at 6:48









                Dharmesh Vekariya

                7121622




                7121622










                answered Mar 7 at 2:02









                Faizan KhanFaizan Khan

                331311




                331311



























                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55034627%2fcss-sass-select-elements-based-on-class-but-exclude-certain-elements-with-same%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

                    Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

                    Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved