我需要使用预定义的点(顶部和左侧)居中对齐动态文本。如果我使用以下代码,动态文本将保持对齐点。
CSS
Error: [Cake\Routing\Exception\MissingControllerException] Controller class Js could not be found.
Exception Attributes: array (
'class' => 'Js',
'plugin' => NULL,
'prefix' => NULL,
'_ext' => NULL,
)
Request URL: /js/jquery.min.js
Referer URL: http://.../
Client IP: ...
Stack Trace:
#0 /home/.../webroot/index.php(36): Cake\Routing\Dispatcher->dispatch(Object(Cake\Network\Request), Object(Cake\Network\Response))
#1 {main}
HTML
.outer {
display: block;
position: relative;
width: 100%;
max-width: 640px;
height: 480px;
background-color: #EEE;
background-size: contain;
background-repeat: no-repeat;
background-position: center center;
}
.inner {
display: block;
position: absolute;
min-width: 100px;
min-height: 50px;
padding: 20px;
}
.inner--3 {
left: 45%;
top: 200px;
text-align: center;
}
我想实现图1 !
我尝试了所有的东西但仍然给了我图2作为输出!无论如何我可以用CSS实现这个目的吗?