HTML at the front

Source: Internet
Author: User

1.

<table width= "75%" border= "0" cellspacing= "0" class= "Tablenormal" >
<TD class= "tableTitleL1" colspan= "4" > Temperature and humidity </td>

<tr>
<TD width= "25%" height= "" nowrap class= "Tablesingularline" > Connection Status

</td>
<TD class= "Tablesingularline" width= "25%" nowrap><div align= "center" >
<span id= ' State1txt ' ></span>
</div></td>
<TD class= "Tablesingularline" width= "25%" nowrap> working status

</td>
<TD class= "Tablesingularline" width= "25%" nowrap><div align= "center" >
<span id= ' State2txt ' ></span>
</div></td>
</tr>

</table>

The height and width above determine the separation distance between several <tr>. Because 100% will equally divide the with and the height.

When you want one row to be large by itself, you can make its width, heigth designation larger, and the other rows automatically distribute the remaining space evenly.

There are two ways to place content between <td> </td>

1) by <td algin= "Middle" > Specify its location <td width= "25%" height= "" align= "Middle" nowrap class= "Tablesingularline" &G t; Mailing address (fixed) </td>

2) through <div align= "center" >
<span > Mailing Address (fixed) </span>

<TD width= "25%" height= "nowrap class=" Tablesingularline "><div align=" center ">
<span > Mailing Address (fixed) </span></td>

2, the interval between the line and the row

<p>&nbsp;</p>

The P element automatically creates some whitespace before and after it. The browser automatically fills in these spaces, and when added, a space is exclusive to one line

3.

<TD class= "Tablesingularline" width= "25%" nowrap><div align= "center" >
<span id= ' State1txt ' ></span>
</div></td>

<span> and <div> are often shared.

4. The difference between a block element and an inline element

Features of block elements:
① always start on a new line;
② height, row height, margin and inner margin can be controlled;
The ③ width defaults to 100% of its container unless a width is set.
④ it can accommodate inline elements and other block elements

Features of the inline element:
① and other elements are on one line;
The ② is high, the row height and the margin and the inner margin cannot be changed;
The width of the ③ is the width of its text or picture, and cannot be changed.
④ inline elements can only hold text or other inline elements

Transform block elements and inline elements through display:block/inline

http://blog.csdn.net/sunlovefly2012/article/details/16859659

http://www.linuxfly.org/post/413/

HTML at the front

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.