我是html / CSS的新手,正在尝试在两个图像之间放置文本。使用以下代码,我能够做到这一点。但是,如果我需要输入大量文本,则格式会出现乱序,如图所示figure 1
。你能告诉我如何使我的网站看起来像Figure 2
吗?
<!DOCTYPE html>
<html>
<body>
<div class="header">
<img src="http://www.w3schools.com/browsers/pic_chart.jpg" style="vertical-align: middle"/>
<a href="http://www.w3schools.com" style="font-family:Georgia;color:black;font-size:17px;">The site provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL etc. W3schools presents thousands of code examples. By using the online editor provided, readers can edit the examples and execute the code experimentally.</a>
<img src="http://www.w3schools.com/browsers/pic_chart.jpg" style="vertical-align: middle"/>
</div>
</body>
</html>
图1:
图2:
为了进行简单的修复,我将使用HTML表。单行3列表将起作用,并且仅align
在<td>
标签中使用和/或在<img>
标签中使用图片大小。有很多可以使用的属性可以满足您的要求。查看http://www.w3schools.com/html/html_tables.asp
<!DOCTYPE html>
<html>
<body>
<div class="header">
<table>
<tr>
<td>
<img src="http://www.w3schools.com/browsers/pic_chart.jpg" style="vertical-align: middle">
</td>
<td>
<a href="http://www.w3schools.com" style="font-family:Georgia;color:black;font-size:17px;">The site provides a reference manual covering any aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL etc. W3schools presents thousands of code examples. By using the online editor provided, readers can edit the examples and execute the code experimentally.
</a>
</td>
<td>
<img src="http://www.w3schools.com/browsers/pic_chart.jpg" style="vertical-align: middle">
</td>
<tr>
</table>
</div>
</body>
</html>
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句