logo
down
shadow

center the div absolute using css but i cannot figure out why its not moving to centre


center the div absolute using css but i cannot figure out why its not moving to centre

By : srikanth
Date : November 29 2020, 01:01 AM
Hope that helps i need to make a div position absolute and make it in center but i used does not make it happen. i have gone crazy trying to make it to the center. i have tried using left and right value to 0. it should have made the div to the center automatically. need to figure out what went wrong? , You forgot to set the position to absolute
code :


Share : facebook icon twitter icon
UIView.center = UIImageView.center but image view doesn't seem to be in centre in landscape

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

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

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?

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

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>
Related Posts Related Posts :
  • Adding a drop down transition to CSS Menu
  • CSS Media Queries not kicking in when there supposed to
  • Video JS - poster image cover/contain
  • simple css code, i dont understand
  • Autoformatting LESS code with vim
  • Can we use different CSS language/pre processors for different components in a Angular Project
  • combined multiple classes into one css rule
  • Detect mobile device browsers, not only screen width
  • CSS folded corners of div with shadow
  • bootstrap 3: why do my <div>s stack from 992 px width onwards when using "col-sm-6"
  • IE7, IE8 support for css3 media query
  • Gradient ends are blurry when using pixel measurements
  • display bootstrap popovers outside divs with overflow:hidden
  • How to make a non responsive site by using Bootstrap?
  • Selecting an element that doesn't have a child with a certain class
  • Embedded Twitter Widget Height issue
  • Twitter Bootstrap - How to get buttons to be block level only on extra small and small devices
  • How can I add a vertical scrollbar to my div automatically?
  • Trouble changing the link font color using typography.js in gatsby
  • Nesting up scss with main.scss and subcomponent scss files
  • Why does my FontSquirrel font not work?
  • Div positioning (overlays when not wanted)
  • Align button vertically in alert field
  • CSS: display: flex and text ellipsis on the same element
  • Fixed position buttons appearing in incorrect area depending on browser
  • CSS-menu issue in angular project
  • Responsive Website - general enquiries
  • Webkit Scrollbar Buttons only showing horizontal
  • explicitly set a field's width in css to "no-auto"
  • Jekyll accessing page variables from CSS
  • Why did my #wrapDesktopNavBar disappear on desktop view?
  • CSS Menu Multiple Hover Colo(u)rs
  • Line-height works differently on Mac and Windows
  • Resizing an image at will with CSS?
  • CSS Naming Best Practice in MVC Layouts
  • FireFox & Chrome CSS Differs
  • Gradient Border Causing the Border to Disappear
  • How to hide column label on google chart
  • How to change H3 color in bootstrap using CSS file
  • CSS How to align checkbox image
  • css3 jagged edge on left isntead of right
  • display text in a horizontal line , using ng-repeat and bootstrap
  • Css right top corner
  • Bootstrap keep button other border gradient when removing border-left
  • Getting divs in the right postion
  • Rails 4: Sass raises SyntaxError when precompiling assets on server but not on development computer
  • Boostrap css file overrode my css file
  • Why are placeholder selectors inside @keyframes valid .scss?
  • Create a 4x4 responsive grid of squares with a margin of 20px on each side of the container?
  • CSS Not Selector: Select All Except Inside of Element
  • CSS Intellisense for files not in solution
  • Overlapping Anchor Tags When Hovering Over One
  • Any way to keep Susy from changing font-size automatically?
  • In Chrome’s user agent stylesheet, why use "-webkit-margin-before" et al instead of just "margin-top"
  • Responsive slanted border
  • SCSS variables - same name, different value in different media breakpoints
  • How to create overlay over div without defining it in HTML
  • Using negative values fails the execution in SASS
  • up/down arrow key issue with typeahead control (angular bootstrap UI)
  • increase size of search terms in a magento site by applying css class-name
  • shadow
    Privacy Policy - Terms - Contact Us © ourworld-yourmove.org