简体   繁体   English

WebView 中的图像和文本对齐

[英]Image and text alignment in WebView

I have a WebView with a few text and images.我有一个带有一些文本和图像的WebView Here's how it looks right now:这是它现在的样子:

在此处输入图片说明

The portion (w-2)/2 comes from an image source, while the portion -10 comes directly as a text. (w-2)/2来自图像源,而-10部分直接作为文本出现。 All I'm trying is to keep the text at the center (rather than bottom) after the image source, so that it looks more logical.我所尝试的只是将文本保留在图像源之后的中心(而不是底部),这样它看起来更合乎逻辑。

Is there a way I could achieve it?有没有办法实现它?

You can use some CSS rules like vertical-align or maybe float: left;你可以使用一些 CSS 规则,比如vertical-align或者float: left;

http://www.w3schools.com/cssref/pr_pos_vertical-align.asp http://www.w3schools.com/cssref/pr_pos_vertical-align.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM