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 7487935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:41:40+00:00 2026-05-29T14:41:40+00:00

I’m trying to use :after selector to draw a inside-border in every div I

  • 0

I’m trying to use :after selector to draw a inside-border in every div I hover. Now the ":after" pseudo class doesn’t work? any idea why this selector doesn’t work? if I just use the :hover pseudo class works, the thing is that I want to use both classes!

Have a look at this EX

thanks!

<body>
    <h1>Example Six</h1>
                
    <p>Grade: A</p>
    <p>this is the thing</p>

    <div class="w3c">
        <div id="tab16">
            <a href="#tab16">cars</a>
            
            <div class="test">
                <div><img alt="" src="http://placehold.it/176x106/" /></div>
            </div>                    
        </div> <!-- ends tab16 -->        
        <div id="tab17">
            <a href="#tab17">othercars</a>
        <div>
            <div><img alt="" src="http://placehold.it/180x110/" /></div>
            <div><img alt="" src="http://placehold.it/180x110/" /></div>
        </div>
    </div> <!-- ends .w3c -->
</body>

The css:

@charset "utf-8";
/* CSS Document */
    
.w3c {
    min-height: 250px;
    position: relative;
    width: 554px;
}
.w3c > div {
    display: inline;
}
.w3c > div > a {
    margin-left: -1px;
    position: relative;
    left: 1px;
    text-decoration: none;
    color: #fff;
    background: #666666;
    display: block;
    float: left;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-bottom: 1px solid white;
}
.w3c > div:not(:target) > a {
    border-bottom: 0;
    background: #b0b0b0;
    /*-moz-linear-gradient(top, white, #eee); */
}   
.w3c > div:target > a {
    background: white;
    color: #b0b0b0;
}
                
.w3c > div > div {
    background: white;
    z-index: 0;
    left: 0;
    top: 30px;
    bottom: 0;
    right: 0;
    padding: 10px;
    border: 1px solid #ccc;
    width: 596px;
    height: 133px;
}   
.w3c  div  div > div {
    border: 1px solid red;
    float: left;
    width: 180px;
    height:110px;
    margin-left: 10px;
}
.w3c  div div > div:hover:after {
    border: 1px solid black;
    width:178px;
    height: 108px;
}
            
/* .w3c > div > div > a  > img:after {
    border: 2px solid black;
    width:178;
    height: 108px;
} */
.w3c > div:not(:target) > div {
    position: absolute;
}
.w3c > div:target > div {
    position: absolute;
    z-index: 1;
}
  • 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-29T14:41:41+00:00Added an answer on May 29, 2026 at 2:41 pm

    For the :after pseudo-element to show up you need to give it content and display it as a block.

    Then, absolutely position the :after and relatively position the div itself:

    .w3c div div > div {
        position: relative;
        border: 1px solid red;
        float: left;
        width: 180px;
        height: 110px;
        margin-left: 10px;
    }
    
    .w3c div div > div:hover:after {
        display: block;
        content: '';
        position: absolute;
        border: 1px solid black;
        width: 178px;
        height: 108px;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.