HTML tags offer the foundation for website shape. To supply more flexibility with HTML shape, characteristics have been defined for HTML tags to alter the behavior of any specific HTML tag. There are numerous cases while designing a website when you should change the standard behavior of the tag. For instance, you could like to change the background color of the entire page or some section of the page. You could wish To change the alignment of the section of text or apply a special design to a tag’s representation. There are numerous cases when you’d wish To identify an HTML tag by providing it a name to find it thus it is referred to elsewhere. Some tags, like the one utilized to present an image (
) don’t do much of anything without at minimum 1 feature defined. In the case of the image tag, you’d need an feature that informs the browser where the find the image to be displayed.
Some Examples of HTML Attributes
Using bgcolor and background with all the body tag
A especially noticeable illustration of the impact of a feature employed in an HTML tag is changing the background color or image for the body of the website. Browsers recognize that the contents of the tag is shown found on the key element of the internet page. By standard, the background utilized by browsers when they encounter the tag is white. Should you need a background color different than white, you’d employ the bgcolor feature. The following tag changes the background color of the website within the standard white to gray:
If you like to have an image include the background for a website, you may utilize the following code:
This illustration assumes that you have a folder on your internet host called pictures, and that inside that folder there is an image called background.gif. In the case of the background image, if the image isn’t big enough to fill the whole background of the website, the browser can repeat the image vertically and horizontally to fill the background.
Linking utilizing the anchor tag
The planet broad web’s fundamental efficiency hinges on its ability to link documents, providing internet consumers with a fast connection from 1 page to another associated page. Linking documents in HTML is completed utilizing the anchor () tag. The anchor tag alone doesn’t tell the browser where to link. Instead, you need to include the href feature as in the following example:
Visit our sponsor
This part of HTML code informs the browser that the text “Visit our sponsor” is the anchor text for a link. When the consumer clicks found on the anchor text, he is taken to the url oursponsorswebsite.com.
Displaying a pic utilizing the image tag
HTML pages will be very boring without the utilization of pictures. The should tell the browser where to locate an image is a wise illustration of ways to use HTML characteristics. Images are included utilizing . Similar to the anchor tag illustration above, utilizing the tag alone wouldn’t suffice. The image tag feature “src” is needed to tell the browser where to locate the image to be shown, as in the following example:
This block of code informs the browser to put an image in the document. The browser is instructed to receive the logo.gif image within the pictures folder found in the best level folder for the document. You equally see a width feature defined in the tag. This constrains the image to be 150 pixels broad. Easily, the height of the image is constrained proportionally when the width feature is defined.
HTML Attributes Reference
Don’t feel like you must memorize all HTML tags and their related characteristics. Instead, it’s advantageous to access a reference when struggling to determine which attributes is chosen with specific HTML tags. The official description for HTML tags and characteristics is found at www.w3.org You are able to equally discover additional resources for learning the same info by utilizing a look engine to look for “html tags” or “html attributes”
Beyond HTML Attributes
In the mid-1990’s, a methodology called Cascading Style Sheets (CSS) was developed for employ in webpage to create them more streamlined. CSS is a standard for defining the design and formatting for a website. Many of the characteristics that have been popular with HTML tags before CSS came about are today handles by CSS definitions. For designers unknown with CSS or who, for whatever cause, don’t select to utilize CSS, HTML attributes that overlap with CSS definitions will nevertheless be employed to change the behavior of HTML tags. But, to be considered vogue in the planet of internet shape, it is actually suggested that you understand and utilize CSS.