• Resolved sacconi

    (@sacconi)


    Someone has the right css to have this effect? When a user puts the cursor in the post box the box-shadow should change color (from grey to orange). At the moment I’ve been able to only highlight the image-border

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Here’s relevant the CSS giving the little border/shadow around each post:

    #content .post {
        box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    }

    So if you want to override this on hover, all you need to do is add the :hover pseudoclass to the selector, and change the style accordingly:

    #content .post:hover {
        box-shadow: 0 1px 3px 0 rgba(255, 165, 0, 0.1);
    }

    The above should have the described effect on hover, but the effect will not be as profound as you’d expect because of the 0.1 opacity and 0 spread (spread is the 0 before the rgba).

    Here’s something more profound:

    #content .post:hover {
        box-shadow: 0 1px 3px 3px rgba(255, 165, 0, 1);
    }

    You may use MDN’s box-shadow generator to generate your desired shadow effect (NB: copy ONLY the box-shadow line from the generated CSS code).

    Good luck!

    Thread Starter sacconi

    (@sacconi)

    thank you. And what if I would display this effect only to category pages and not on single post page?

    I’m supposing you want this on all archive-type listings (categories, tags, date, etc) — and not just categories.

    If so, then try:

    .archive #content .post:hover {
         box-shadow: 0 1px 3px 3px rgba(255, 165, 0, 1);
    }

    If you indeed want this on CATEGORIES ONLY, change the .archive above to .category.

    Good luck!

    Thread Starter sacconi

    (@sacconi)

    Ok thank you. I worked a little on your css and now I got what I wanted, great!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘cursor on post-box changes color of box-shadow simulating an highlight’ is closed to new replies.