HTML Attribute Flashcards
(24 cards)
What are attributes and how do they work
An attribute is a value placed inside the opening tag of an HTML element
Attributes provide additional information about the element or specify how the element should behave
Common HTML attributes
Href attribute
Another Common HTML attribute
Is the src or the source and the alt attribute which is used here to specify the source of an image and provide alternative descriptive text for the image respectively
Type attribute
The type attribute is use to specifies the type of input
Input attribute
The input attribute are used to collect data form users
Check attribute
The check attribute is used to specify that the check box should be checked by default
Boolean attribute
boolean attribute is an attribute that can either be present or absent in an HTML tag
Common Boolean attribute
Is disabled , read-only , and required these attributes are used to specify the state of an element
What is a Charset attribute
a charset attribute is attribute inside the meta element ,example <meta charset=utf-8/>
What is the id attribute and what’s it use for
The id attribute adds unique identifier to and HTML element . example <h1 id=”title> movie review page</h1>
What should the ID attribute contain
The only contain letters, digits , underscores ,dashes
What is the class attribute and it use
The class attribute adds an identifier to an HTML element or multiple HTML elements . example <id class=”box”</div>
When are classes best used
Classes are best used when you want to apply a set of styles to many elements
What is the name attribute
The name attribute is were you put your description to show that the browsers search engine and other web tools can correctly interrupt the metadata
What is the content attribute
The content attribute is where you will place your description
What is the Property attribute
The property attribute is used to specify that this a OG colon title
What is the Loop attribute
The loop attribute is a boolean attribute that makes audio repla continuously. example <aduio src=https://cdn.freecodecamp.org / curriculum / js -music-player /can’t stay-down.mp3
loop
controls
What is the mute attribute
The mute attribute mutes the aduio before hand the mute attribute is also a Boolean attribute
What is the target attribute
The target attribute tells the browser where to open the url for the anchor element. examples < a href=https://”freecodecamp.org” target=”_self”
What are examples of the target attribute
_self , _ blank , _parent , _top
What is _self value
his is the default value for the target attribute. This opens the link in the current browsing context. In most cases, this will be the current tab or window.
What is _blank value
This opens the link in a new browsing context. Typically, this will open in a new tab. But some users might configure their browsers to open a new window instead.
what is _parent value
This opens the link in the parent of the current context. For example, if your website has an iframe, a _parent value in that iframe would open in your website’s tab/window, not in the embedded frame.
What is _top value
This opens the link in the top-most browsing context - think “the parent of the parent”. This is similar to _parent, but the link will always open in the full browser tab/window, even for nested embedded frames.