javascript - 在 angularJS 中的图像 HTML、CSS 上重叠文本区域或文本
问题描述
我正在为研究创建一个网站。
当我创建文本区域和一些表单工作时,
我不知道如何重叠图像和文本。
这是我想在下面做的一个例子 这是截图的例子
如何像上传的图像一样在图像上重叠文本区域或文本?
谢谢!
<div class = "container">
<img src = '/assets/img/Iphone.png' alt="Snow" width = "300" height = "530" style = "margin-top: -1300px; margin-left:-200px">
<div class="centered" style = "margin-top: -800px; margin-left: -10px; padding: 10px;" src = '/assets/img/Iphone.png'>hello</div>
</div>
作为第二个示例,我想为“hello”制作背景颜色。
解决方案
将元素定位在父元素的右下角
.wrapper {
position: relative;
width: 100%;
height: 200px;
}
.wrapper textarea {
width: 100%;
height: 100%;
}
.wrapper .counter {
position: absolute;
bottom: 0;
right: 0;
}
<div class="wrapper">
<textarea></textarea>
<div class="counter">Foo</div>
</div>
推荐阅读
- angular - Angular & RxJS Duplicate Code with subscriptions - 将代码移动到服务、类型和取消订阅
- c# - 从属性连接集合
- python - 如何制作平方数列表?
- javascript - 如何在 socket.io 服务器中调用节点 api 响应
- c++ - 初始化具有非默认构造函数的 std::array 项的更好方法?
- z3 - 如何简化 Z3 输入格式(如删除和合并操作)并将其转换为普通的布尔表达式?
- python - 如何在 rpy2 中使用 gamlss
- python - 未使用 WTForms 在 Flask 中使用多个表将数据保存到 SQLite DB
- python - 不支持 ssd_inception_v2。有关与不同版本 TensorFlow 兼容的特征提取器,请参阅 `model_builder.py`
- vert.x - 无法使用 VertxUnitRunner 运行测试