UIView.center = UIImageView.center but image view doesn't seem to be in centre in landscape
By : Δημητρης Βλαχος
Date : March 29 2020, 07:55 AM
I wish this help you The center of a view is expressed in it's superview's coordinate system. So you are centering your image view in the wrong coordinate system. (dynamic view's superview as opposed to dynamic view) To centre view A within view B, the centre point of view A has to be the centre of the bounds rectangle of view B. You can get this using (from memory!) CGRectGetMidX and CGRectGetMidY.
|
How to centre image in absolute div
By : carina s
Date : March 29 2020, 07:55 AM
will help you Hello how can I center this magnify when I hover an image? Here is my jsfiddle: , Use: code :
.portfolio-bt {
position: absolute;
top: 0;
left: 0;
bottom:0;
right:0;
margin:auto;
width:470px;
height:380px;
background: none;
border-radius: 0px;
border:1px solid #fff;
}
|
centring content/text in absolute div absolute; transform from center
By : user3788978
Date : March 29 2020, 07:55 AM
around this issue Add this into your .cat-icn style block: transform: translate(-50%,-50%);. This should bring it dead center.
|
Bootstrap: How to position Image in Centre absolute?
By : pan xi
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , How can I place image in centre of page, behind the in responsive html. , Used left:50% with transform property in #uvod-ahoj code :
#uvod-ahoj {
position: absolute;
right: 0;
left: 50%;
transform: translate(-50%);
-webkit-transform: translate(-50%);
-moz-transform: translate(-50%);
-o-transform: translate(-50%);
-ms-transform: translate(-50%);
}
#uvod-ahoj-div {
position: relative;
color: white;
background-color: #780d4f;
}
#uvod-ahoj-div > h1 {
color: white;
margin: 3rem 0;
padding: 3rem 0 0 0;
}
#uvod-ahoj-div > p {
margin: auto;
max-width: 60rem;
padding-bottom: 3rem;
}
<div class="col-md-6 text-center center-block">
<img src="../res/uvod-ahoj.png" class="" alt="" id="uvod-ahoj">
<div id="uvod-ahoj-div">
<h1>Ahoj, som...</h1>
<p>
<strong>Marcela Špalková</strong> a s pekným oblečením sa kamarátim od malička. Začalo to listovaním módnych
časopisov, pokračovalo vymýšľaním vlastných outfitov a šitím šiat pre bábiky. Táto moja vášen
sa naplno prejavila pri nákupoch, vyberala som kúsky nielen pre seba, ale aj pre kamarátky.
</p>
<a href="" class="btn" id="uvod-btn">POZRIEŤ MOJE SLUŽBY</a>
</div>
</div>
|
centre an absolute rounded div above another absolute position div
By : Victor
Date : March 29 2020, 07:55 AM
it fixes the issue Something like this? You should also add an translate(-50%,-50%) to the animation. Otherwise, it deletes translate(-50%,-50%) on and overwrites it. code :
.location {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 120px;
height: 120px;
border-radius: 50%;
border: 16px solid #f3f3f3;
border-top: 16px solid #3498db;
border-bottom: 16px solid #3498db;
animation: Location 4s linear infinite;
}
@keyframes Location {
0% {
transform:translate(-50%, -50%) rotate(0deg);
}
100% {
transform:translate(-50%, -50%) rotate(360deg);
}
}
.line {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 8px solid #f3f3f3;
width: 500px;
}
<div class="location"></div>
<div class="line"></div>
|