« Home « Kết quả tìm kiếm

HTML cơ bản - p 11


Tóm tắt Xem thử

- <td>.
- lt;/td><td>.
- .72</td><td>.
- 225 days</td><td>.
- 243 days</td>.
- 1.0</td><td>.
- 365 days</td><td>.
- 24 hrs</td>.
- <td> lt;/td><td>.
- 1.5</td><td>687 days</td><td>.
- 24.6 hrs</td>.
- Links are the lifeblood of the Web, and Hypertext is the name of the Markup Language.
- The link element is discussed further in the sec- tion “Page Head Information” in Chapter 5.
- The anchor element, <a></a>.
- Because the introduction of the first graphical web browsers in 1993, the default formatting behavior for browsers is to underline the text content of an anchor element and make it blue (linked images get a blue border).
- One of the first browser enhancements was to give both web authors and browser users the ability to change the style and color of links.
- The area element must always be the child of a map element, which can be referenced by an image element elsewhere on the page.
- The map and area elements are explained in the section.
- 1 The protocol method to be used to access the resource 2 A username if the resource requires authentication 3 The hostname of the server providing the resource 4 A port number to be used on the server.
- 5 The directory path to the resource 6 The filename of the resource.
- 7 The anchor name or ID of an element in the HTML document 8 Parameters to be passed to the resource.
- The username, hostname, and port parts of the URL are not used with the file protocol.
- The mailto protocol method signals that the browser should open a new message in the user’s email client.
- title="Request for information">Email Us</a>!.
- To link to another HTML document in the same directory as the current one, only the filename is needed.
- A user agent fills in the missing informa- tion from the current document’s URL before sending the request to the web server.
- Data has a cat named <a href="spotdata.html">Spot</a>.
- As long as the files reside in the same logical directory, none of the relative links need to be updated when the collection is moved to another server or domain.
- To link to a specific place in the destination page, follow the filename with a pound sign.
- and the id of the HTML element that corresponds to that place in the destination page:.
- <a href="spotdata.html#habits">Spot</a>.
- If the file is in a subdirectory of the directory containing the current file, the anchor element’s link to the preceding file would be written like this:.
- <a href="pets/spotdata.html">Spot</a>.
- shorthand can be used to write a link to a resource in the parent directory of the current file:.
- <a href="../officers/">List of Officers</a>.
- <a href gt;Enterprise Home</a>.
- <a href="http://enterprise.ufp.mil/pets/spotdata.html">Spot</a>.
- Optional parameters can be sent to a web server resource by adding a ques- tion mark.
- to the end of the URL with a list of name-value pairs separated by ampersands (&.
- </a>.
- The show_log script has access to the information in the parameters and knows that the request is for the captain’s log, stardate 1512.2.
- The link created by an anchor or area element can be in one of four states: nor- mal, hover, active, or visited.
- A link is in the visited state if it has been visited before in recent history.
- The length of time a link remains in the visited state is a function of the browser’s preference settings.
- The colors that a browser uses to indicate the normal, active, and visited states to the user can be set with link , alink , and vlink attributes of the body element, as shown next.
- In CSS, the state of an anchor element can be selected for rule assignment using the pseudo-selectors: link , hover , active , and visited .
- The following CSS rules set the same values as the attributes in the preceding body tag and change the background color when the user’s mouse hovers over an anchor element..
- Other CSS statements in the document’s styles can set different values for spe- cific elements and classes of elements..
- Changes in the state of an anchor can be detected using event handler attributes such as onmouseover , onmouseout , onfocus , onblur , onclick , onmousedown , and onmouseup..
- The target attribute provides the name of the browser window in which to open the requested document.
- A window’s name is an internal name that can be used by scripts in one document to play with the elements of another document loaded into a dif- ferent window.
- It is not the same as the window title, which is set by the title attribute in the document’s head section.
- GIF format is limited to 256 colors in a single image but does permit one color in the image’s palette to be treated as fully transparent by the displaying browser or other software.
- JPEG images feature a variable compression setting that can be used to balance image quality with file size..
- The last format, Portable Network Graphics (PNG) format, can be used for either simple illustrations or colorful photographs.
- It also has alpha transpar- ency that can be controlled by CSS settings and manipulated by client-side scripts.
- This makes it possible to fade the image in and out in response to a user’s activity..
- No paragraph breaks or additional white space around the image are implied..
- If text flow around the image is not specified, the image is inserted into the text like a single odd-sized character.
- Unlike an image in a page layout pro- gram, which can be anchored to a specific spot on the page, an inline image on a Web page is part of the text in which it is embedded.
- An inline image can be placed anywhere a text character can be placed..
- The image tag has two important, required attributes.
- The source attri- bute, src , provides the URL of the file containing the image data.
- The URL in a source attribute follows the same rules as a URL in the href attribute of an anchor or area element.
- alternative description of the image that can be read by robots and displayed by browsers if the image is unavailable or cannot be displayed for some reason..
- The alternative text should not be considered a description of the image.
- Note the use of the align attribute in the second image tag to align the “top” of the image with the top of the line of text it is embedded in..
- alt="Mystery Man"/></p>.
- <p><a href="report.html".
- title="Report sighting"><img src="bigYes.png".
- align="top"/></a>.
- </p>.
- alt gt;<img src .
- In the former case, the carriage returns ending each line in the HTML source are treated as white space between the images.
- In the latter case, there are no spaces between the images.
- If the containing element is narrower than the total width of the three images, horizontal scrolling may be enabled.
- Or depending on the properties of the containing element, the images can either be clipped or allowed to overflow into adjacent content..
- <div align="center"><img src="images/300-8.gif".
- alt="book cover"/><br/>.
- Cover of the First Edition</div>.
- <figcaption>Cover of the First Edition</figcaption>.
- It can be used with any con- tent that can in some way be separated from the main part of the document, including tables and code samples.
- The figure element aids search engine optimization by distinguishing images that are part of the content from images that are purely decorative.
- When images are taller than they are wide, text and other content can be directed to flow around the image, either on the right or left side by giving the value "left".
- respectively, to the image element’s align attribute.
- But, when the align attribute has one of the values: "top".
- it specifies how the image should be aligned with the adjacent text.
- The default is to align the bottom of an image with the baseline of the text.
- aligns the top of the image with the top of the tallest character in the current line, as illustrated in Figure 2.22.
- aligns the middle of the image with the baseline of the text..
- Two additional attributes, hspace and vspace , can be used to control the amount of horizontal and vertical space around a floating image.
- The image element’s border attribute applies only when the image is inside an anchor tag.
- Its value is the size of the border in pixels.
- This is use- ful when it is otherwise obvious that the image represents a hypertext link..
- The image element can also be specified with height and width attributes..
- Their function in the image tag is performance-related.
- If specified, the height and width attributes allow the browser to reserve a space of that size in the appropriate place on the page..
- This allows the browser to continue formatting the page while the image is being downloaded, speeding up the process for the reader.
- If the height and width attribute values are not the same as the corresponding dimensions of the image, the browser scales the image to that size.
- Fun effects can be achieved by setting an image’s height or width to a per- centage value

Xem thử không khả dụng, vui lòng xem tại trang nguồn
hoặc xem Tóm tắt