Attributes

Updated: 09/12/2023 by Computer Hope

Attributes may refer to any of the following:

1. With computer systems, attributes are the characteristics of a file in the context of a file system. For example, if the file had a read-only attribute, the file cannot have any changes (write protection) and can only be read. See our file attributes definition for further information about this type of attribute.

2. Attrib is a command that lets you adjust the attributes of a file in MS-DOS and Windows. See our attrib command page for further information on this command.

3. Within an HTML (HyperText Markup Language) tag, an attribute dictates certain aspects of an element. Attributes are made up of a name and value pair. In the 'a' tag example below, "href" is an attribute name with the value "hope.html."

HTML tag

Do I need quotes around attribute values?

Yes. Although today's browsers can read attribute values with missing quotes around them, it's best practice to use double quotes to prevent errors.

How many attributes can a tag have?

A tag could have as many valid attributes as needed as long as they're separated by a space and not duplicated. For example, the following tag has three different attribute names.

<a href="hope.html" class="big" style="color:red">Computer Hope</a>

In the above example, the link points to the hope.html file, uses the big class defined in CSS (Cascading Style Sheets), and is stylized as red text.

How to add multiple attribute values

Multiple attribute values can be added by separating them with a space. For example, in the following example, we moved the font color into a CSS file and called it "red."

<a href="hope.html" class="big red">Computer Hope</a>

Is the order of attribute values important?

No. As long as the attributes are separated by spaces, they can be in any order.

4. With an attribute in a word processor, it is a characteristic of a character, word, or line. For example, an underlined word has an underline attribute.

5. In database management systems, an attribute is sometimes used as a synonym for a field.

6. With a game, an attribute is any value given to a character or item that gives it additional abilities. For example, with a character, an attribute may be how much strength the character has. With an item, an attribute may be how much damage a weapon can do. These values are also commonly called stats.

7. An attribution or attributing indicates the source of something. For example, indicating the author of a quote is an attribution. In the example below, Albert Einstein is being attributed as saying this quote.

Never memorize something that you can look up.
-Albert Einstein
Note

See our cite page for further information about attributing Computer Hope in your work.

Archive attribute, Cite, Database terms, Display attribute, Fair use, Flag, Geek Code, Operating system terms, Parameter, Permission, Read-only, Read/Write, Software terms, Word processor terms, Write