Example of implementing text wrapping in html (mixed text and images in html)

Example of implementing text wrapping in html (mixed text and images in html)

1. Text around the image

If we use the normal one, for example:

Copy code
The code is as follows:

<TABLE cellpadding="15" width="200">
<TR>
<TD bgcolor="#EEEEFF"><IMG src="test.gif" hight=60>Here is the normal one. Among domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by programming enthusiasts. </TD>
</TR>
</TABLE>

In such a sentence, if the image is taller than the text, there will be a blank space above the text. The page performance is very bad. How to solve it? Please look at this code:

Copy code
The code is as follows:

<TABLE cellpadding="15" width="200">
<TR>
<TD bgcolor="#EEEEFF"><IMG src="test.gif" hspace="1" align="LEFT" hight=60>Here is a wraparound layout. Among domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by programming enthusiasts. </TD>
</TR>
</TABLE>

The problem can be solved by adding this attribute to the img element: align="center". Simple, right? As for hspace, it defines the width of the image and surrounding elements. It does not matter whether it is wrapped or not.

How was this made? Let’s take a look at this code first:

Copy code
The code is as follows:

<table align=left cellspacing=0 cellpadding=0 width=200 border=1>
<tr>
<td><table align=left cellspacing=0 cellpadding=0><font color=red size="5"><b>Among </b></font> </table> domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by program enthusiasts. (End)</td></tr>
</table>

How to achieve such an effect?

Copy code
The code is as follows:

<table align=left cellspacing=0 cellpadding=0 width=200 border=1>
<tr>
<td><table align=left cellspacing=0 cellpadding=0><font color=red size="5"><b>在</b></font>
</table>Among the domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by programming enthusiasts. (End)</td></tr>
</table>

This code snippet explains it. You, as a smart person, will know it at a glance. Just put the words you want to enlarge in this table.

But now what if I want the text to have a background color? Ha, you are so smart. Add the bgcolor attribute to the table, like this:

Copy code
The code is as follows:

<table align=left cellspacing=0 cellpadding=0 width=200 border=1>
<tr>
<td><table align=left cellspacing=0 cellpadding=0 bgcolor=#C0C0C0><font color=red size="5"><b>Among </b></font></table> domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by program enthusiasts. (End)</td></tr></table>

But can you come out? No, there is still something to add (remember not to answer so quickly next time :), like this:

Copy code
The code is as follows:

<table align=left cellspacing=0 cellpadding=0 width=200 border=1>
<tr>
<td><table align=left cellspacing=0 cellpadding=0 bgcolor=#C0C0C0><td><font color=red size="5"><b>Among </b></font></td></table> domestic VB websites, vbgood is updated daily and has rich information, and is deeply loved by program enthusiasts. (End)</td></tr></table>

<<:  How to solve the margin collapse problem in CSS

>>:  5 Steps to Implement Responsive Web Design Method and Say Goodbye to Waterfall Model (Graphic Tutorial)

Recommend

Solution to MySQL connection exception and error 10061

MySQL is a relational database management system ...

Uniapp realizes sliding scoring effect

This article shares the specific code of uniapp t...

In-depth analysis of MySQL database transactions and locks

Table of contents 1. Basic Concepts ACID 3.AutoCo...

mysql update case update field value is not fixed operation

When processing batch updates of certain data, if...

How to let DOSBox automatically execute commands after startup

Using DOSBox, you can simulate DOS under Windows ...

Sample code for partitioning and formatting a disk larger than 20TB on centos6

1. Server environment configuration: 1. Check dis...

Completely uninstall mysql. Personal test!

Cleanly uninstall MySQL. Personally tested, this ...

Vue3 list interface data display details

Table of contents 1. List interface display examp...

Detailed tutorial on installing ElasticSearch 6.4.1 on CentOS7

1. Download the ElasticSearch 6.4.1 installation ...

Practical experience of implementing nginx to forward requests based on URL

Preface Because this is a distributed file system...

Detailed explanation of MySQL 5.7.9 shutdown syntax example

mysql-5.7.9 finally provides shutdown syntax: Pre...

Graphic tutorial on installing Mac system in virtual machine under win10

1. Download the virtual machine version 15.5.1 I ...