What are attributes in computing? (2024)

What is an attribute?

For example, eye color is an attribute of a person, while screen size is an attribute of a smartphone or TV. In computing and computer programming, an attribute is a changeable property or characteristic of some component of a program that can be set to different values.

What are attributes in computing?

In computing, the term attribute is used in many different contexts. In the context of a file system, it refers to a characteristic of a file in that system. So, a particular file can have a read-only attribute, which means it is write protected and can't be changed. Another file may not have this attribute, so a person or an application can both read and write to it.

Similarly, in an HTML tag used in building a web page, an attribute specifies certain aspects of an element on a page and could have a specific value.

In object-oriented programming, attributes are defined for classes and objects. It's a data element that represents the quality or state of the class or object.

What are attributes in computing? (1)

An attribute defines a particular property of an object, element or file. It can also refer to a specific value for a given instance of that property. In most cases, a property owner would own these property attributes. All attributes are associated with a set of operations that determine what is and isn't possible to do with that attribute and the object, element or file it defines.

What are attributes in HTML?

In markup languages like Hypertext Markup Language (HTML) and Extensible Markup Language (XML), attributes describe data and data formatting. Thus, an attribute is usually a characteristic of an HTML page element, such as font color.

While programming in HTML, a user can set font attributes, such as size and color, to different values. Thus, p style="color:red" sets the paragraph attribute to red so the text will display in red. Similarly, they can set other attributes, such as font size, image path and web page language.

In short, different attributes provide additional information about HTML elements. They're usually written in the form of a name/value pair with the syntax name="value".

The most common attributes in HTML are:

1. href

The href attribute, represented by the <a> tag specifies the destination URL of the page a link goes to.

Example

<a href="https://www.techtarget.com/whatis/definition/attribute">What is attribute?</a>

2. src

The src attribute specifies the path/source of an image being displayed. It's accompanied by the <img> tag. The URL can be specified in two ways using the src attribute: absolute URL and relative URL.

The absolute URL links to an external image on a third-party website.

Example

<img src ="https://www.externalwebsite.com/images/img_phone.jpg ">

A relative URL links to an image hosted within the same website.

Example

<img src =”img_phone.jpg ">

While both are valid, it's usually better to use relative URLs because the image won't break if the domain is changed. An absolute URL depends on an external website, so if its domain changes or goes down, the image will break and affect user experience (UX).

3. Width and Height

These attributes specify the width and height of the image in pixels. They're also used with the <img> tag.

Example

<img src ="img_phone.jpg " width="260” height="480">

4. alt

The alt attribute specifies an alternate text for an image. This text tells the user what the image is about. It's indexed by search engines and also read aloud by screen reader software such as that used by visually impaired users. The alt attribute is especially important if the image is missing or broken, and is important from both an SEO and UX perspective.

Example

<img src ="img_phone.jpg " alt="Android smartphone with stylus"">

5. style

The style attribute is used to add different styles to an HTML element, such as color, font or size.

Example

<p style="color:purple;"> This is a purple paragraph.</p>

6. lang

The lang attribute, which is always included inside the <html> tag, declares the language of the web page to help search engines and browsers. A country code can be added to the language code if there are many country-level variants of a language. English is one such language.

Example

<html lang="en"> for the US

<html lang="en-UK"> the United Kingdom

7. title

The title attribute adds extra information about an HTML element. Its value is displayed as a tooltip when a user mouses over that element.

Example

<p title="I am a tooltip"> This is a paragraph.</p>

What is an attribute in a database management system?

In a database management system (DBMS), an attribute may describe the characteristics or properties of a component or entity, such as a database table or a field. If the database is compared to a spreadsheet, the attribute is simply one -- non-null -- cell or the conjunction of a particular column and row.

An entity in a DBMS may contain any number of attributes. If a row in the database contains invoice entries, attributes for these entries could include invoice number, date created, data paid and value. If the row contains student details, attributes could include name, date of birth or age, gender, address, roll number and phone number.

What are attributes in computing? (2)

There are different types of attributes in a DBMS. These include:

Simple attributes

Simple attributes are independent and can't be classified further or subdivided into other components. They are also known atomic attributes.

An example of a simple attribute is the age of a person.

Composite attributes

Composite attributes can be subdivided into different components or subparts. One or more simple attributes form composite attributes.

A common example of a composite attribute is the address of a person, which can be composed of their street name, city name, ZIP code and country.

Single-valued attributes

Single-valued attributes contain a single value for each entity instance. These values remain constant and can't be subdivided into other attributes.

Date of birth, age and gender are all examples of single-valued attributes.

Multivalued attributes

Unlike single-valued attributes, multivalued attributes can store more than one value at a time from a set of possible values.

Email address and phone number are two examples, since a person can have more than one email address and phone number.

Derived attributes

Derived attributes draw their values from other attributes. One example is the age attribute that's derived from the date of birth attribute.

Key attributes

Key attributes can uniquely identify an entity from a set. These attributes always have non-repeating values. An example is a person's social security number, which is unique to an individual.

Complex attributes

Complex attributes are formed by combining multivalued and composite attributes. They usually have many subsections and are rarely used in DBMS.

For example, an attribute called "addr_emph" represents a person's physical address, email address and phone number. The address is a composite attribute, while the phone number and email address are multivalued attributes. Combining them creates the complex attribute.

Stored attributes

Stored attributes have fixed values for an entity. They also help to set derived attributes. For example, age is a derived attribute of date of birth, while date of birth is a stored attribute of age.

What are attributes in DOS?

In the disk OS (DOS), file properties like read-only or visible are known as file attributes. These attributes are the metadata of a DOS file and may include the following properties:

  • file path or location,
  • file size,
  • directory,
  • contents
  • timestamps and
  • permissions.

The attrib command is used to display or change file attributes. The most common options are:

Options (with attrib)Action

+

Sets an attribute

R

File is read-only

A

Archive file

-

Clears an attribute

S

System file

H

Hidden file

Learn about relational databases, how to create an HTML5 and PHP file upload form for Apache and explore the difference between functional and object-oriented programming.

What are attributes in computing? (2024)

FAQs

What are attributes in computing? ›

In computing, an attribute is a specification that defines a property of an object, element, or file. It may also refer to or set the specific value for a given instance of such. For clarity, attributes should more correctly be considered metadata. An attribute is frequently and generally a property of a property.

What is an example of an attribute? ›

What is an attribute? For example, eye color is an attribute of a person, while screen size is an attribute of a smartphone or TV. In computing and computer programming, an attribute is a changeable property or characteristic of some component of a program that can be set to different values.

What do you mean by an attribute? ›

An attribute is a quality or characteristic given to a person, group, or some other thing. Your best attribute might be your willingness to help others, like when you stopped traffic so the duck family could cross the street.

What are attributes in database? ›

Inside a database, an attribute is an identifying piece of information that serves to define further and expand the primary key. See how attributes work with functional dependency and their relation to tables inside a database.

What is attribute coding? ›

Attribute coding is a type of data coding used to analyze qualitative data, such as interviews and focus groups. It is a process of organizing the collected data into distinct categories and assigning a unique code to each category. The codes are then used to identify and analyze patterns and themes in the data.

What are two examples of attributes data? ›

Attribute data is data whole that identify, position, time and describe a spatial object. Characteristics data can be, for example, a building identifier, street address, year of construction and purpose of use of a building.

What are the three basic types of attributes? ›

An Attribute can be understood as a property or characteristic of an entity, providing essential information about the data stored in the database. Further, in this blog, we will explore the different Types of Attributes in DBMS, including simple, composite, single-valued, and multivalued Attributes.

What are common attributes? ›

A common attribute is a data element and is associated with a record in the system. A common attribute has the following properties: Name. Type. Default value (for example, a common attribute field on the user interface can show a default value that a user can change)

What are attributes in SQL? ›

Attributes are objects that are contained in Master Data Services entities. Attribute values describe the members of the entity. An attribute can be used to describe a leaf member, a consolidated member, or a collection.

What is an attribute in Python? ›

Attributes in Python are variables that belong to an object and contain information about its properties and characteristics. They can be used to represent details or facts related to the object.

What are attributes in Excel? ›

attribute: A characteristic of some object or entity, typically encoded as a name/value pair.

How do you write an attribute? ›

Writing an attribute is similar to writing text to a new element. In this case, we'll add a reference URI to our document. Full code:Appendix F, Code for Add Attribute Example. First we add a new node at the location of the current node pointer, cur.

What is an attribute in Java? ›

Attributes in Java can be of any data type, including primitive types (like int , double , boolean ) and reference types (like String , arrays, or other objects). The choice of data type depends on what the attribute is meant to represent.

What is an attribute in HTML? ›

An HTML attribute is a piece of markup language used to adjust the behavior or display of an HTML element. For example, attributes can be used to change the color, size, or functionality of HTML elements.

What is an example of an attribute in HTML? ›

Attributes are specified within the opening tag of an element and consist of a name and a value, separated by an equals sign. Common attributes include “class” for defining CSS styles, “id” for uniquely identifying an element, and “src” for specifying the source of an image or media file.

What's an attribute in C++? ›

Attributes in C++ are like some additional condition which is written with the code, and the compiler is bound to follow that particular condition. These attributes can be any condition or any information attached to variables or functions.

What is simple attribute with example? ›

Simple attributes are those that cannot be further divided into sub-attributes. For example, A student's roll number of a student or the employee identification number. These attributes are usually assigned by an organization and are used to identify an individual within that organization uniquely.

What is list of attributes? ›

List attributes are FME's way of allowing multiple values per attribute. Some FME readers represent recurring values in the original data source in a list. As well, some transformers create a list as a result of their processing, usually when attributes from different features are grouped into a single feature.

How do you identify an attribute? ›

Entities contain attributes, which are characteristics or modifiers, qualities, amounts, or features. An attribute is a fact or nondecomposable piece of information about an entity. Later, when you represent an entity as a table, its attributes are added to the model as new columns.

Top Articles
Latest Posts
Article information

Author: Manual Maggio

Last Updated:

Views: 5964

Rating: 4.9 / 5 (69 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Manual Maggio

Birthday: 1998-01-20

Address: 359 Kelvin Stream, Lake Eldonview, MT 33517-1242

Phone: +577037762465

Job: Product Hospitality Supervisor

Hobby: Gardening, Web surfing, Video gaming, Amateur radio, Flag Football, Reading, Table tennis

Introduction: My name is Manual Maggio, I am a thankful, tender, adventurous, delightful, fantastic, proud, graceful person who loves writing and wants to share my knowledge and understanding with you.