Attributes Flashcards
What is an attribute?
An attribute is used to define the characteristics of an HTML element and is placed inside the element’s opening tag. All attributes are made up of two parts − a name and a value
What is an id attribute?
The id attribute of an HTML tag can be used to uniquely identify any element within an HTML page
What is a title attribute?
The title attribute gives a suggested title for the element. It is often displayed as a tooltip when cursor comes over the element or while the element is loading.
What is a class attribute?
The class attribute is used to associate an element with a style sheet, and specifies the class of element.
What is a style attribute?
The style attribute allows you to specify Cascading Style Sheet (CSS) rules within the element.
example:
style = “font-family:arial; color:#FF0000;”
How do you define the direction of the text in an html element?
Using the dir attribute and it takes 2 vlues rtl or ltr.
example:
dir=”rtl”
What attribute is used to align text in element horizontaly?
align and it takes 3 values left, center or right.
What attribute is used to align text in element verticaly?
valign and it takes 3 values top, middle or bottom.
What attribute is used to put a background color for an element?
bgcolor and it takes numeric, hexidecimal or RGB values.
What attribute is used to put a backgound image for an element?
background and it takes a url.
What attribute is used to specify the width of tables, images or table cells?
width
What attribute is used to specify the height of tables, images or table cells?
height