移动横向视图图像位置:绝对

时间:2017-12-04 09:08:47

标签: html css

import { ViewPropTypes } from 'react-native';

MyComponent.propTypes = {
  style: ViewPropTypes.style
};

请帮助:移动纵向视图位置正确。但在中间右侧的移动景观视图中.. (我在纵向视图中放置查看所有内容的底部 .. 没有滚动条) 如何解决?

1 个答案:

答案 0 :(得分:0)

你可以这样试试

.imgcenter{
position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40%;
  height: 50%;
  text-align: center;
}
<img src="https://unsplash.it/200/80" alt="" class="imgcenter">