Search
 
SCRIPT & CODE EXAMPLE
 

CSS

center div in div without flex with position absolute

div.cn {
    position: relative;
    width: 200px;
    height: 200px;
    background: gray;
    text-align: center;
}

div.inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    -webkit-transform: translate(-50%, -50%);  
    transform: translate(-50%, -50%);   
    background: red;
  
}
Comment

PREVIOUS NEXT
Code Example
Css :: warning: LF will be replaced by CRLF in Design/css/bootstrap.min.css. 
Css :: placeholder color in css 
Css :: template html css bootstrap cdn 
Css :: add css to express app 
Css :: bootstrap media query 
Css :: bootstrap cheat sheet 
Css :: image responsive css 
Css :: css selector not empty input 
Css :: change default arrow icon for accordion in bootstrap 
Css :: remove the dotted border on links 
Css :: table properties css 
Css :: scrollbar css 
Css :: last child after css 
Css :: scss exceeded maximum budget. Budget 7.00 kB was not met by 841 bytes with a total of 7.82 kB. 
Css :: media queries 
Css :: background shorthand 
Css :: how to center a div with position absolute 
Css :: vertical and horizontal align center div 
Css :: is there any property that reset all atributes css div 
Css :: css focus change color 
Css :: css nth-child 
Css :: padding css 
Css :: background-attachment 
Css :: remove input border on focus 
Css :: how to link css to html flask 
Css :: laravel enum float 
Css :: 1rem to px 
Css :: button click css style 
Css :: loading bar css 
Css :: how to change button border color in css 
ADD CONTENT
Topic
Content
Source link
Name
3+7 =