Tài liệu The Least You Need to Know about HTML, CSS, and the Web

Thảo luận trong 'Thiết Kế Web' bắt đầu bởi Thúy Viết Bài, 5/12/13.

  1. Thúy Viết Bài

    Thành viên vàng

    Bài viết:
    198,891
    Được thích:
    173
    Điểm thành tích:
    0
    Xu:
    0Xu
    Attributes
    Attributes allow variety in how an element describes content or works.
    Attributes let you use elements differently depending on circumstances. For
    example, the <img /> element uses the src attribute to specify the location
    of the image you want to include on your page:
    <img src=”images/header.gif” alt=”header graphic” width=”794” height=”160” />
    In this bit of HTML, the <img /> element itself is a general flag to the browser
    that you want to include an image; the src attribute provides the specifics
    on the image you want to include — header.gif in this instance. Other
    attributes (such as width and height) provide information about how to
    display that image, while the alt attribute provides a text alternative to the
    image that a text-only browser can display (or a text-to-speech reader can
    read aloud, for the visually impaired).
    Chapter 7 describes the <img /> element and its attributes in detail.
    You include attributes within the start tag of the element you want them
    with — after the element name but before the ending sign, like this:
    <tag attribute=”value” attribute=”value”>
    XML syntax rules decree that attribute values must always appear in quotation
    marks, but you can include the attributes and their values in any order
    within the start tag or within a single tag.
     

    Các file đính kèm: