📜  如何在HTML中对齐图像-JavaPoint

📅  最后修改于: 2020-11-04 01:05:01             🧑  作者: Mango

如何在HTML中对齐图像

如果要使用Html标签将图像移动到网页上的其他位置,则必须遵循以下步骤。

步骤1:首先,我们必须在任何文本编辑器中键入Html代码,或者在要对齐图像的文本编辑器中打开现有的Html文件:


   
    
   
Align an Image


 
Hello User!
This page helps us to understandhow to specify an image at a particular position in a pargraph using the Html tag.  
 


第2步:现在,将光标放在我们要对齐的图像的标签。然后,我们必须使用img标签的align属性来指定位置。因此,我们必须按照以下块中的描述键入align属性。


步骤3:指定位置后,我们必须保存HTML代码,然后运行文件。以下是各种HTML代码,它们在段落中的不同位置显示了图像:

1.中

该对齐值将图像设置在中间。


   
    
   
Align an Image at middle


 
Hello User!

This page helps us to understand how to align an image in Html. It is first section in this page which describes how to specify an image at middle in a pargraph using the Html tag.

下面的屏幕快照显示了以上HTML代码的输出:

2.顶部

该对齐值将图像设置在顶部。


   
    
   
Align an Image at Top


 
Hello User!

This page helps us to understand how to align an image in Html. It is Second section in this page which describes how to specify an image at top in a paragraph using the Html tag.

下面的屏幕快照显示了以上HTML代码的输出:

3.底部

该对齐值将图像设置在底部。


   
    
   
Align an Image at bottom


 
Hello User!

This page helps us to understand how to align an image in Html. It is third section in this page which describes how to specify an image at bottom in a paragraph using the Html tag.

下面的屏幕快照显示了以上HTML代码的输出:

4.左

该对齐值将图像设置在左侧。


   
    
   
Align an Image at left


 
Hello User!

This page helps us to understand how to align an image in Html. It is fourth section in this page which describes how to specify an image at left side of a paragraph using the Html tag.

下面的屏幕快照显示了以上HTML代码的输出:

5.对

该对齐值将图像设置在右侧。


   
    
   
Align an Image at Right


 
Hello User!

This page helps us to understand how to align an image in Html. It is fifth section in this page which describes how to specify an image at right side of a paragraph using the Html tag.

下面的屏幕快照显示了以上HTML代码的输出: