You need to set position
to absolute
or relative
:
#inner {
width: 400px;
height: 300px;
background-color: #090;
position: absolute;
left: 50%;
}
More Related Contents:
- Positions fixed doesn’t work when using -webkit-transform
- Position an element relative to its container
- Prevent an element from covering another [closed]
- Two column width 50% css [closed]
- vertical-align with Bootstrap 3
- One flex/grid item sets the size limit for siblings
- How to align content of a div to the bottom
- CSS Pseudo-classes with inline styles
- Are the decimal places in a CSS width respected?
- How to apply a style to an embedded SVG?
- How do I get this CSS text-decoration override to work?
- Why does position:relative; appear to change the z-index?
- Color for Unicode Emoji
- Browser Caching of CSS files
- How to change scroll bar position with CSS?
- How to keep footer at bottom of screen [duplicate]
- How to give the background-image path in CSS?
- Bootstrap – 5 column layout
- Is there a way to get a web page header/footer printed on every page?
- How to implement curve background in CSS? [duplicate]
- How to prevent text from overflowing in CSS?
- How to darken a background using CSS?
- How to keep :active css style after click a button
- How to make CSS Grid items take up remaining space?
- CSS attribute selector does not work a href
- Make a perfect circle around a div of variable height
- Why is my .sticky-top class not working in Bootstrap 4?
- Use the HTML tag as a background image instead of the CSS background-image property?
- Make plus symbol in CSS
- Flex elements ignore percent padding in Firefox