HTML and CSS Reference
In-Depth Information
Table A-3 HTML Tags and Attributes
(continued)
HTML Tag and Attributes
Description
<iframe>….</iframe> *
(continued)
name=
text
*
Assigns a name to the current frame
noresize
*
Prevents the user from resizing the frame
sandbox=
allow-option
Specifies restrictions to the frame content
new
scrolling=
option
**
Adds scroll bars or not—always, never, or add when needed
seamless=seamless
Specifies that the iframe should be seamlessly integrated
new
src=
URL
*
Defines the URL of the source document that is displayed in the frame
srcdoc=
HTmL_code
Specifies the HTML of the document showing in the iframe
new
width=
pixels
*
Sets the frame width to a value in pixels
<img>….</img>
Inserts an image into the current Web page
align=
type
**
Defines image alignment in relation to the text or the page margin
alt=
text
Provides a text description of an image if the browser cannot display the
image; should always be used
border=
value
**
Sets the thickness of the border around the image to a value in pixels;
value is 0 or 1; developers discouraged from using this
height=
pixels
Sets the height of the image to a value in pixels (not percentages); should
always be used
src=
URL
Specifies the URL of the image to be displayed; required
usemap=
#mapname
Specifies the map of coordinates and links that defines the href within
this image
width=
pixels
Sets the width of the image to a value in pixels (not percentages); should
always be used
<input>….</input>
Defines controls used in forms
alt=
text
Provides a short description of the control or image button; for browsers
that do not support inline images
autocomplete=on, off
Specifies whether or not the input field should have focus on page load
new
new
autofocus=autofocus
Specifies that the input field should have focus on page load
checked=checked
Sets radio buttons and check boxes to the checked state
disabled=disabled
Disables the control
form=
form_id
Specifies one or more forms the input element belongs to
new
new
formaction=
URL
Overrides the form's action attribute. Defines where to send the data when
the form is submitted (for type=”submit” and type=”image”)
formenctype=
encoding
Overrides the form's enctype attribute. Defines how form data should
be encoded before sending it to the server (for type=”submit” and
type=”image”)
new
formmethod=get, post
Overrides the form's method attribute. Defines the HTTP method for
sending data to the action URL (for type=”submit” and type=”image”)
new
formnovalidate=
formnovalidate
Overrides the form's novalidate attribute. Defines that the input element
should not be validated when submitted
new
formtarget=_blank, _self,
_parent, _top,
framename
Overrides the form's target attribute. Defines the target window to use
when the form is submitted (for type=”submit” and type=”image”)
new
new
height=
pixels, %
The height of an input element (for type=”image”)
new
new
list=
datalist_id
Refers to a datalist that contains predefined options for the input element
new
new
max=
number, date
Specifies a maximum value for an input field
maxlength=
number
Sets a value for the maximum number of characters allowed as input for a
text or password control
new
New with HTML5
* Deprecated tags
** Not supported in HTML5