[HTML beginners] 2. HTML attributes: html attributes for beginners
HTML attributes
Attributes provide additional information for HTML elements.
HTML tags can have attributes. Attribute provides more information about HTML elements.
An Attribute always appears in the form of a name/value pair, for example, name = "value ".
Attributes are always specified in the starting tag of the HTML element.
========================================================== ============
Attribute instance
HTML links are defined by <a> tags.
The link address is specified in the href attribute:
<A href = "http://www.w3school.com.cn"> This is a link </a>
========================================================== ==============
Attribute Example 2:
<Body> defines the subject of an HTML document.
<Body bgcolor = "yellow">
Has additional information about the background color.
========================================================== ================
You are familiar with setting these attributes in the xml file of android.
For example, android: background = "# ff0000"
Set various properties of controls
========================================================== ============
In addition, I also got a copy of the HTML attribute manual, and I couldn't put any attachments here. It was found by baidu Library.
============================== END =========================== ="
HTML
You can also use HTML to edit this page...
Html for beginners, two minor issues
I don't know if what I understand is accurate. I hope you will understand the following code:
Style settings:
<Div class = "a"> <div class = "title1"> Title 1 </div> <div class = "title2"> Title 2 </div> CSS style:
. A {width: 200px; height: 100px; position: relative ;}
. Title1 {width: 100px; height: 30px; position: absolute; top: xx px; left: xx px ;}
. Title2 {width: 100px; height: 30px; position: absolute; top: xx px; left: xx px ;}
In this way, you can adjust the top and left values of title1 and title2 Based on the frame of your background image to move it to the desired position. If the title content is too long to be hidden, overflow: hidden, line-height: 30px will be added;
Question 2:
If you want to apply the page to. net, you can directly copy the corresponding part of the html code to the corresponding location of the asp.net page. In addition to the header declaration, the asp.net page has some special tags which are not declared in html.
Hope to help you!
Html tag attributes
Detailed Description: HTML
Tags and attributes
In HTML, tags are usually composed of the start tag and the end tag. The start tag is represented by "<Tag Name>", and the end tag is represented by "</Tag Name>.
Elements refer to the whole, including tags. The content that removes tags is called content.
Attribute must be specified in the start tag to indicate the nature and characteristics of the tag. It is usually expressed in the form of "property name =" value ". multiple attributes can be specified after being separated by spaces. When multiple attributes are specified, no order is required.
Specify the color
There are two ways to specify the color with HTML
1. Use a hexadecimal value to specify the value. After #, use the hexadecimal value to represent the RGB options.
2. Specify the color name: You can use the name to specify the color of the base 16 colors.
Location of the specified file
When you set a link for a part, you need to specify the location of the link HTML file. Similarly, if you want to display the image here, you also need to specify the location of the image. In HTML, this location is represented by a URL. There are two Representation Methods:
1. absolute URL: the absolute URL is the path starting with http: // displayed in the address bar when you view a webpage in a Web browser.
2. Relative URL: The relative URL is set within the same site, similar to managing files on the same disk. This method is based on the location of the current file. When a relative URL is used, if the file to be specified is at the lower level of the current file, it is written to the file name to be specified starting from the directory name, separated by the "/" symbol in the middle. If you add a "../" symbol to the upper-level of the current file
2. Basic Content
Display HTML Version
<! DOCTYPE ~>
The HTML Version indicates the version of the HTML file (indicating the DTD file that the HTML file complies with). Different versions and types have fixed writing formats, enter the start of the file according to the fixed format, and then specify the version at the beginning of the file, according to the format specified by this version
Required tags
<Html> ~ </Html>
<Head> ~ </Head>
<Title> ~ </Title>
<Body> ~ </Body>
The HTML file must start with <! DOCTYPE ~> The HTML Version, followed by four tags that must exist.
First, <! DOCTYPE ~> The following html tags must be used (Enter the information related to the file in the head tag, and enter the content that century will display in the browser in the body tag. In addition, you can only have one title tag in the head tag that represents the file title.
Set the text color of the page
<Body text = "color specified"> ~ </Body>
Set the background color of the page
<Body bgcolor = "color specified"> ~ </Body>
Set the background image of the page
<Body background = "image URL"> ~ </Body>
Set range by Purpose
<Div> ~ </Div>
<Span> ~ </Span>
Insert comments
<! -Comment statement -->
3. Set File Information
Add title
<Title> ~ </Title>
The title tag is used to add titles to HTML files.
This label must be... the remaining full text>