【发布时间】:2016-02-24 01:21:42
【问题描述】:
我是 stackoverflow 的新手。我在问HTML代码。在我的源代码中,我有一个高度为 214 像素(宽度为 163 像素)的图像。我也有这个想法。如果我设置一个段落标签,它不会出现在它旁边,而是在它下面。我试图避免使用 CSS“位置:绝对”答案,因为我希望它也与移动设备兼容。只是想知道我们是否可以使 p 标签显示为相同的高度,但设置的权重与图像平行。这是我的代码:
<!DOCTYPE html>
<HTML>
<HEAD>
<TITLE>Personal Webpage | Home</TITLE>
<meta charset="UTF-8">
<meta name="description" content="content, homepage">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE-edge, chrome=1">
<link rel="shortcut icon"
href="favicon.ico"
type="image/x-icon" />
<link href="style.css" type="text/css" rel="stylesheet" media="all and (max width: 5120px)"/>
</HEAD>
<BODY>
<div class="center">
<header><img src="header.png" alt="alttext" height="44px" width="792px" border="1px"/></header><br><h3><b>lorem ipsum dolor solem amit</b></h3></div><br><img src="img/image1.jpg" alt="" height="214px" width="163px" border="1px"><figcaption>Caption</figcaption>
<p style="border: 1px solid black;" width="100px" height="214px">lorem</p></p>
</BODY>
</div>
</HTML>
【问题讨论】:
标签: html image parallel-processing paragraph