html - How to align a div element using the center of the page as a reference? -
so i'm trying element align percentage center of page.
so i've tried replacing i'd put percentage either left or right "center"
.aboutcredit { z-index:-100000; center:25%; top:75%; transform:translatey(-50%) translatex(-50%); position:fixed; text-align:center; vertical-align:middle; }
but no luck. kind of i'm trying here:
i don't know if have noticed, center:25%;
nothing. want left:50%
. seeing want moved 25%, make left:75%;
, should you're looking for. so:
.aboutcredit { width: 50px; height: 50px; background-color: black; z-index: 1; position: absolute; left: 75%; top: 50%; transform: translate(-50%); text-align: center; vertical-align: middle; }
<div class="aboutcredit"></div>
Comments
Post a Comment