Click here to Skip to main content
15,891,896 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Needed State: the border top and left should be placed at the top left corner of the image (with maximum 50% of width or height), and the border bottom and right should be placed at the bottom right corner of the image (with maximum 50% of width or height) as well.
Action: when the image is hover
HTML structure:
HTML
<div class="col-lg-4 col-md-4 col-sm-12 portfolio-img-wrap">
    <img src="images/portfolio/5.jpg" class="img-fluid">
    <div class="portfolio-topleft"></div><div class="portfolio-bottomright"></div>
</div>


CSS lines:
CSS
.portfolio .portfolio-topleft:before {
	border-top: 2px solid #757575;
	width: 60%;
}
.portfolio .portfolio-topleft:after {
	border-left: 2px solid #757575;
	height: 45%;
}
.portfolio .portfolio-bottomright:before {
    border-bottom: 2px solid #757575;
}
.portfolio .portfolio-bottomright:after {
    border-right: 2px solid #757575;
}


::there are other positioning css but it's not the problem lay, so I'll just leave it::

Problem: as you can see, giving width and height to border top and left worked well as wanted but when did the same to border bottom, it was placed at the left only (eg. width 50%) and border-right placed at the top corner (eg. height 50%)

Needed Solution:
How can I make the border-bottom stay at the right corner when it is only width:50% and border-right at the bottom... so the two meets at bottom-right corner (against the other two @ the top left)


What I have tried:

Problem: as you can see, giving width and height to border top and left worked well as wanted but when did the same to border bottom, it was placed at the left only (eg. width 50%) and border-right placed at the top corner (eg. height 50%)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900