What kind of information do attributes provide?


This exercise says that attributes can provide information. What kind of information do attributes provide?


There are several different types of attributes which can extend tags in different ways. Usually attributes either change an element’s behavior, provide metadata about the element, or provide labeling information about the element. For example, the id attribute uniquely identifies an element whereas the class attribute identifies a whole group of elements. This labeling information can then be used to target content for styling, scripting, or (for the id attribute) linking. For more information about these attributes, check out classes vs ids.


+ =


You should include that link when all the people on that lesson had completed Unit 5 of HTML and CSS course. I’ve spotted that several of your links do not concord with the average level of the people who click on it. Be patient and try to only share information that the average user can digest. If you link them to extensive courses, original documentation or other information which may need prerequisites you are only going to depress them.


It's quite true! When looking through the FAQs, the one on global attributes made me like want to run away. Please for the purpose of readers who might not yet be as advanced as you are, please try to simplify in simpler words.


i really don’t understand the use of attributes


What have you read in the documentation?

HTML Standard


The example that’s given in the linked article actually doesn’t work. There are some coding syntax issues and I am not able to run the code and output the desired page.

1 Like

We want to >learn< coding… so we have no understanding of the meaning of >the code< It is very useful to see that we don’t know it all… never the less is the motivational degree below average when you can not approach knowledge by misunderstanding the code it is written in. Therefor my simple advice>> keep it sesame :slight_smile:


1 Like



Milk before the Steak please.

I’m 64 and have clients that want me either to update existing websites built by others in many different codes where I have to sleuth. Back “in the day” when computers were just starting to “inroad” the profession, such as Typesetting and Pagination I learned coding for three prominent providers. Coding was exact because the Graphic Production Artist needed exact results. Then I took Code Academy’s courses back in 2013 to try to learn HTML and CSS. I was depressed and “broken” at the end because the explanations didn’t include reasons as to the “why” things were coded, and why they are coded in the ways they are. For instance, I never realized that what I called “the loosie goosie” web coding was compared to the absolute coding of the past for publishing. For example. Publishing is exact, web needs the flexible, fluid coding to be able to deal with screen resolutions, flux line breaks, etc as a viewer may not be able to read small text and need to enlarge the web page. Coding needs to be able to deal with variables such as this.

So, explanations such as what I just wrote about will help new coders make sense of why it is the way it is instead of the “just do it this way” presentation.


I respectfully disagree. I am a beginner that finds it useful to scan through extensive reference to get the gist of what is required. Everyone has different learning styles. I may not see the big picture now, but I learn how each topic fits together better with a 2 min article scan.


Attribute is used to metadata section or when you need to connect two they are used

When I noticed that my knowledge was not where it should be to digest the information, I closed the link. Of course, I noticed that from the beginning.

Well, that just goes to show how different people are. Some like the extra info, some have time and/or capacity to process and digest it, but others may have limited time, resources or just plainly don’t have the available space (in their mind) to learn that much at that time.

I think that it is useful to have the links, and I also closed the link to information that I am not able to process just yet, but I bookmarked it for a later stage.

So, I suggest that other noobs like me, do something similar, but I also suggest that those topics which may seem overwhelming, also be explained in a shortened version, elsewhere - but also include that link. This may seem to heap up responsibilities, but if you have taken on a responsibility to teach, maybe you’ll find it in your heart to help out us poor noobs to understand even more.

That said, I love this course so far, haven’t really run into much problems. Plus it’s free, so… hehe… I’m not complaining, it’s just a suggestion… Thank you for all your hard work and your willingness to share.

God bless.

I don’t really understand what the purpose of the id of the div is for.

id is a special attribute for identifying important page fragments or uniquely purposed elements that exist only once in a page. We only use that attribute when we wish to hook the page fragment in a URL, or when we wish to target only that one particular element with a special selector rule.

The attribute is not intended for blanket use, but special cases such as mentioned above. The key to remember is that it can only appear once in a page as a unique id.

<div id="main">


From anywhere in the page, or even in the page navigation we can hook this element with a link:

<a href="#main">Main Content</a>

There are other technical details but they will surface as you gain familiarity with markup, styling and behavior, as a whole. We can go into greater detail once you’re comfortable with the basic concept of ‘unique identifier’.

Here is an example of how we might target that page fragment in a website address:

<a href="https://www.example.com/products.html#main">Products</a>
<!--                                           hash           -->

The segment in the URL starting with # is known as the URL ‘hash’.


Thanks so much this helps lots