Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Weird and The Wonderful
  4. CSS selector of the day

CSS selector of the day

Scheduled Pinned Locked Moved The Weird and The Wonderful
c++cssarchitecture
13 Posts 10 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Chris Maunder

    :not as in:

    a:not([href]) { color: inherit; text-decoration:none; }

    This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

    cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

    B Offline
    B Offline
    BobJanova
    wrote on last edited by
    #4

    Nice. Are there any (*: doesn't work in browser X) conditions on this? I know the conditional selectors generally don't play nicely with IE.

    C 1 Reply Last reply
    0
    • C Chris Maunder

      :not as in:

      a:not([href]) { color: inherit; text-decoration:none; }

      This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

      cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

      S Offline
      S Offline
      Sentenryu
      wrote on last edited by
      #5

      +5, it's nice to see some wonderful code, as oposed to the waves of weirdos... EDIT: if you can, make this really a OTD series, as a CSS Selector OTD has really a great potential...

      I'm brazilian and english (well, human languages in general) aren't my best skill, so, sorry by my english. (if you want we can speak in C# or VB.Net =p)

      1 Reply Last reply
      0
      • C Chris Maunder

        :not as in:

        a:not([href]) { color: inherit; text-decoration:none; }

        This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

        cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

        Y Offline
        Y Offline
        Yvan Rodrigues
        wrote on last edited by
        #6

        Thanks for the tip.

        Yvan Rodrigues Red Cell Innovation Inc.

        1 Reply Last reply
        0
        • B BobJanova

          Nice. Are there any (*: doesn't work in browser X) conditions on this? I know the conditional selectors generally don't play nicely with IE.

          C Offline
          C Offline
          Chris Maunder
          wrote on last edited by
          #7

          BobJanova wrote:

          Are there any (*: doesn't work in browser X) conditions on this

          No support on IE8 and earlier, unfortunately.

          cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

          F 1 Reply Last reply
          0
          • C Chris Maunder

            BobJanova wrote:

            Are there any (*: doesn't work in browser X) conditions on this

            No support on IE8 and earlier, unfortunately.

            cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

            F Offline
            F Offline
            fjdiewornncalwe
            wrote on last edited by
            #8

            Bah... No one uses old browsers like that anyway... :)

            I wasn't, now I am, then I won't be anymore.

            1 Reply Last reply
            0
            • C Chris Maunder

              :not as in:

              a:not([href]) { color: inherit; text-decoration:none; }

              This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

              cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

              J Offline
              J Offline
              jayson lorenzen
              wrote on last edited by
              #9

              Thanks for posting this, and to CP for hilighting it in their newsletter email today. This is a pretty cool thing that I had not seen before, probably hidden in plain site right in front of me though.

              1 Reply Last reply
              0
              • C Chris Maunder

                :not as in:

                a:not([href]) { color: inherit; text-decoration:none; }

                This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

                cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                C Offline
                C Offline
                Cesar de Souza
                wrote on last edited by
                #10

                Is this what you are using to prevent anchored headings in CodeProject articles from being shown in blue instead of orange? ;P

                Interested in Machine Learning in .NET? Check the Accord.NET Framework. See also Handwriting Recognition Revisited: Kernel Support Vector Machines

                C 1 Reply Last reply
                0
                • C Cesar de Souza

                  Is this what you are using to prevent anchored headings in CodeProject articles from being shown in blue instead of orange? ;P

                  Interested in Machine Learning in .NET? Check the Accord.NET Framework. See also Handwriting Recognition Revisited: Kernel Support Vector Machines

                  C Offline
                  C Offline
                  Chris Maunder
                  wrote on last edited by
                  #11

                  yeah :)

                  cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                  1 Reply Last reply
                  0
                  • C Chris Maunder

                    :not as in:

                    a:not([href]) { color: inherit; text-decoration:none; }

                    This makes all A tags that don't have a href (eg a <a name=...> bookmark) take their colour from their parent and removes the hover underline. I just thought it was eloquent enough to share.

                    cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                    J Offline
                    J Offline
                    jsc42
                    wrote on last edited by
                    #12

                    Non-CSS version - as used in Netscape Navigator 4, Internet Explorer 4, and many later browsers:

                    text to be bookmarked

                    or

                    text to be bookmarked

                    C 1 Reply Last reply
                    0
                    • J jsc42

                      Non-CSS version - as used in Netscape Navigator 4, Internet Explorer 4, and many later browsers:

                      text to be bookmarked

                      or

                      text to be bookmarked

                      C Offline
                      C Offline
                      Chris Maunder
                      wrote on last edited by
                      #13

                      Empty anchors don't always work. They should. They don't.

                      cheers, Chris Maunder The Code Project | Co-founder Microsoft C++ MVP

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups