HTML learning (1), html learning

Source: Internet
Author: User

HTML learning (1), html learning

1. Abbreviations and acronyms <abbr> <acronym>

<Abbr title = "etce.pdf"> etc. </abbr>

<Acronym title = "World Wide Web"> WWW </acronym>

2. Block reference (short)

<P>:
<Q> B </q>
C </p>

Result: A:"B"C

3Computer output tag

<Code> define computer code

<Kbd> define the keyboard code

<Samp> define computer code samples

<Var> define code samples

<Pre> define predefined format text

4. Link-target attributes

Syntax: <a herf = "url"> Link text </a>

You can use the target attribute to define where the linked document is displayed.

<A herf = "url"Traget = "_ blank"> Link text </a>

Use this attribute if the page is fixed within the framework: target = "_ top"

5. Font, font color, and size

Font-family (font), color (color), and font-size (font size)

6. Text alignment

Text-align

7. Images

Image Tag and source attribute <src>

Image-alt attribute: alt defines a string of prepared and replaceable texts for the image

8. Table

Tag

<Table>: Define a table.

<Th>: Define the table header.

<Tr>: defines a row.

<Td>: Define a table unit.

<Caption>: Define the table title.

<Colgroup>: defines the group of table columns.

<Col>: defines the attributes of table columns.

<Thead>: Define the table header.

<Tbody>: defines the table body.

<Tfoot>: footer

Some attributes

Border: border Width

Colspan = "n": Cross-Column

Rowspan = "n" cross-row

Cellpadding: the gap between the table content and the border

Cellspacing: the spacing between cells.

9. List

List tag

<Ol>: Define an ordered list

<Ul>: unordered list defined

<Li>: defines the list items.

<Dl>: custom list

<Dd>: Description of the custom list.

<H4> A Definition List: <Dl>
<Dt> Coffee </dt>
<Dd>-black hot drink </dd>
<Dt> Milk </dt>
<Dd>-white cold drink </dd>
</Dl>

Result

A Definition List:
Coffee
-Black hot drink
Milk
-White cold drink

10. Block

<Div> element: set unified attributes for all elements in a region, such as colors and fonts.

<Span>: used to combine the line elements in a document. This label provides a way to separate a part of the text or a part of the document.

11. webpage Layout

Use <div> or table for Layout

Ex: Layout instance

12. Form and Input

Form tag <form>

Input tag <input>

Text Field:The text field is set using the <input type = "text"> label

<Form>
First name: <input type = "text" name = "firstname"> <br>
Last name: <input type = "text" name = "lastname">
</Form>

Password field:The password field is tagged<Input type = "password">To define

<Form>
Password: <input type = "password" name = "pwd">
</Form>

Single button: <input type = "radio">

<Form>
<Input type = "radio" name = "sex" value = "male"> Male <br>
<Input type = "radio" name = "sex" value = "female"> Female
</Form>

Check box: <input type = "checkbox">

<Form>
<Input type = "checkbox" name = "vehicle" value = "Bike"> I have a bike <br>
<Input type = "checkbox" name = "vehicle" value = "Car"> I have a car
</Form>

Submit button: <input type = "submit">

Form tag

<Form>:Define a form for user input

<Input>:Define input fields

<Label>:Definition<Input>Element label, which is generally the input title

<Filedset>:Define a set of related form elements and include them with an external box

<Legend>:Definition<Filedset>Element title

<Select>:Define drop-down list options

<Optgroup>:Define a quota Group

<Option>:Define options in the drop-down list

<Button>: Click the define button.

 

 

 

Related Article

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.