Showing posts with label other. Show all posts
Showing posts with label other. Show all posts

Sunday, July 25, 2010

The <br> Element

The br tag is used to indicate a semantic break in a paragraph. The browser inserts a line break when it encounters this element. Therefore, it continues rendering the content on the next line. This is an empty tag. This element can appear in any element that can contain text.

A paragraph is used to introduce a new idea in a text. The br element can be used when a new idea needs to be introduced, but a new paragraph is not warranted.

Attributes

Apart from the Core Attributes, there is only the clear attribute, which is deprecated in favor of CSS.

clear
This attribute can take the values none, left, right and all. This specifies if the content after the br tag should be rendered in a new line that starts vertically below any floated elements.

Wednesday, September 3, 2008

Important Declarations - !important

An Important Declaration is one which has the string !important inserted before the terminating semi-colon of the declaration.
Example: #main {color: black !important;}
An Important Declaration has the highest weight among CSS declarations. An Important Declaration will outweigh inline style declarations and internal stylesheet declarations too.
If more than one Important Declaration targets a particular element, then the more specific selector will be applied.

Sunday, August 3, 2008

Comments in HTML Code

You can insert comments in HTML as follows: <!-- comment text -->
Comments can be nested inside elements.
<h1><!-- This is a comment -->This is an h1 tag</h1>
Comments cannot be inserted within tags.

Wednesday, July 2, 2008

The Meta tag

<meta name="keywords" content="html, reference, tutorial, css" />
The above tag may be used by search engines to categorize the web page that contains it in its head. Another example:
<meta name="Author" content="Chetan Crasta" />

Image Maps

Client-side image maps are better than server-side image maps.
To make an image a client-side map, use the attribute usemapin the img tag. Its value should be the url anchor of a <map> element. The <map> element can either be in the same page or in an external one.
The map tag contains the <area /> tags. The area tags use the coords attribute to define the area that can be clicked. The coordinates are with respect to the top left corner of the image. The clickable areas can be circles, rectangles or polygons. The clickable area is specified in the shape attribute as either circle, rectangle, or polygon. You can also use the short-forms circ, rect and poly.
For circles, coords="x, y, r" where x and y is the center and r is the radius.
For rectangles, coords="x1, y1, x2, y2" - the first coordinate is the upper-left corner and the second is the bottom-right corner.
For polygons: coords="x1,y1,x2,y2,x3,y3..." the first coordinate should not be repeated.
Finally, the href attribute specifies the link and the alt attribute the alternate text.