div (HTML4 & HTML5)

Defines a special block of content within a document.

Properties & Events

KeyDescriptionAvailability
alignDefines the alignment of the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
classCSS class assigned to the element.
chrome 1.0safari 1.0Firefox 1.0ie 1.0opera 1.0
dirDirection of the element text.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
disabledSpecifies whether or not the element is disabled.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
idUnique identifier for the element.
chrome 1.0safari 1.0Firefox 1.0ie 1.0opera 1.0
langLanguage code for the content of the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
languageScript language for the element.
chrome 1.0safari 1.0Firefox 1.0ie 3.0opera ??
nowrapIf present, specifies that the element text should not wrap.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
styleInline style for the element.
chrome 1.0safari 1.0Firefox 1.0ie 1.0opera 1.0
tabindexPosition of the element in the tabbing order for the document.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
titleShort text description for the element.
chrome 1.0safari 1.0Firefox 1.0ie 1.0opera 1.0
onblurFires when the element loses focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onclickFires when the element is clicked.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
ondblclickFires when the element is double-clicked.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
ondragFires when the element is dragged.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondragendFires when the element is released from being dragged.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondragenterFires when the element has another object dragged onto it that can be dropped on the element.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondragleaveFires when an element has an object dragged out of it that could be dropped onto the element.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondragoverFires when an element has an object dragged over it that could be dropped onto the element.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondragstartFires immediately before an element is dragged.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera N/A
ondropFires when an object is dropped onto the element.
chrome 1.0safari 1.0Firefox 3.5ie 9.0opera ??
onfocusFires when the element receives focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onkeydownFires when a user presses down on a key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onkeypressFires when a user presses a key or holds down the key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onkeyupFires when a user releases a key while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmousedownFires when a user clicks down on the mouse button while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmousemoveFires when the mouse moves while the pointer over the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseoutFires when the mouse pointer moves off of the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseoverFires when the mouse pointer moves over the element.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0
onmouseupFires when the user releases the mouse button while the element has focus.
chrome 1.0safari 1.0Firefox 1.0ie 2.0opera 4.0

Examples having uses of: 'div'

16 votes
18k views

HTML5 details

The details element represents a disclosure widget from which the user can obtain additional information or controls. However, the details element is not appropriate for footnotes.
2 votes
15k views

JavaScript Prompt Object

Prompt box used for taking input from user. If you click on ok button then it return input value else it return null
3 votes
14k views

CSS Animation

CSS3 animations make it possible to animate transitions from one CSS style configuration to another. Animations consist of two components: A style describing the animation and a set of keyframes that indicate the start and end states of the animation's CSS style, as well as possible intermediate waypoints along the way.
1 votes
13k views

CSS Linear Gradient

The CSS linear-gradient function creates an effect which represents a linear gradient of colors on the element. The Top to Bottom gradient effects the element from top to bottom and the left to right gradient effects the element from left to right.
1 votes
12k views

CSS nth-child

The nth child selector is used to select the specified element of the page.
1 votes
12k views

jQuery AJAX Introduction

The jQuery load method is a simple to use AJAX (Asynchronous JavaScript and XML.) function. That enables you to load ajax content with one line of code. AJAX is a technique for creating better and more interactive web applications and we at webgrid.com are using ajax with jQuery alot to make this web page better!
2 votes
12k views

CSS Shadow

CSS shadow work with different elements like box shadow, text shadow etc.
0 votes
12k views

CSS Transition

CSS3 transitions are effects that let an element gradually change from one style to another. To do this, you must specify the effect and the duration.
2 votes
11k views

jQuery - Get CSS information

Using the css property we can get the simple CSS property value of an attribute.
3 votes
11k views

CSS Padding & Margin

A margin is the space outside of the element, whereas padding is the space inside the element.
4 votes
11k views

CSS Rounded Corners

The CSS3 border-radius property allows web developers to easily utilise rounder corners in their design elements, without the need for corner images or the use of multiple div tags or JavaScript.
0 votes
11k views

CSS 2D Transform

CSS3 transform property allows us to scale, rotate, spin, stretch, and turn elements.
1 votes
10k views

HTML5 Drag and Drop

Now HTML 5 came up with a Drag and Drop (DnD) API that brings native DnD support to the browser making it much easier to code up. HTML 5 DnD is supported by all the major browsers like Chrome, Firefox 3.5 and Safari.
0 votes
10k views

CSS Dimension with pixel

The dimension property of the CSS allows us to manage the height and width of the HTML elements.
4 votes
10k views

jQuery Hide & Show

With jQuery, you can hide and show HTML elements with the hide and show methods
0 votes
10k views

CSS3 Multi Columns Basic

CSS multi columns property builds on the Box model module [no public working draft yet] and adds functionality to flow the content of an element into multiple columns.
0 votes
10k views

CSS Flexible Box Basic

The flexible box layout gives us a way of creating flexible boxes. It lets us align and distribute boxes vertically and horizontally as well as have boxes flex to use all available space. You can also display the elements in reverse order compared to how they are ordered in the markup.
3 votes
10k views

jQuery DOM Traversing

jQuery is a very powerful tool which provides a variety of traversal methods to help us select elements in a document randomly as well as in sequential method. In other words, we can say that most of the traversing methods are used to find elements from the documents.
0 votes
9k views

jQuery Support

jQuery.support is a collection of properties that represent the presence of different browser features or bugs. Primarily intended for jQuery's internal use; specific properties may be removed when they are no longer needed internally to improve page startup performance.
1 votes
9k views

CSS selectors

A selector is made up of pattern that is matched against all elements in document.
3 votes
9k views

jQuery Attributes

Some of the most basic components we can manipulate when it comes to DOM elements are the properties and attributes assigned to those elements
3 votes
9k views

jQuery Basic Manipulation

jQuery provides methods to manipulate documents in efficient way. You do not need to write big code to modify the value of any element's attribute or to extract HTML code from a paragraph or division.
1 votes
8k views

jQuery AJAX Life Cycle

jQuery AJAX life cycle demonstration. This is a demonstration of the methods ajaxStart, ajaxSend, ajaxComplete, ajaxStop, and ajaxSuccess that are triggered when load method is called.
4 votes
8k views

jQuery ajaxStart & ajaxComplete

jQuery ajaxStart and ajaxComplete are two functions are very useful to show the graphics while the data is loading from server. The ajaxStart method works while the server fullfilling the service asked to it. The ajaxComplete method is called when the server fulfilled the request.
1 votes
7k views

JavaScript For

Javascripts loops are similar to other programming languages. Loops allows us to execute a block of statements to the specified number of times.
2 votes
6k views

CSS Animation Loop

This allows us to animated the element movement infinitly.
0 votes
3k views

HTML5 Drag and Drop between four elements

Drag and Drop magic with HTML5 using an image to drag back and forth between four <div> elements.
0 votes
2k views

jQuery Toggle

The jQuery toggle method toggles the visibility of HTML elements using the show or hide methods. Shown elements are hidden and hidden elements are shown. The speed parameter can take the following values: "slow", "fast", "normal", or milliseconds.
0 votes
2k views

CSS Ease in and Ease out

CSS3 transitions are effects that let an element gradually change from one style to another. To do this, you must specify the effect and the duration.
2 votes
2k views

HTML Div Layout

The HTML div element is a block level element used for grouping HTML elements.
0 votes
2k views

HTML5 summary

The summary element represents a summary, caption, or legend for the rest of the contents of the summary element's parent details element, if any.
0 votes
2k views

JavaScript clearInterval method

JavaScript clearInterval function enables you to stop the timer event started by the JavaScript setIntterval function. When you apply the setInterval function a JavaScript function by specifying the time interval then it calls the function continuously after equal intervals of time.
0 votes
2k views

jQuery - Multiple CSS properties

jQuery allows to change the multiple CSS properties value at once.
0 votes
2k views

HTML button

The HTML button tag inserts a button control in a form or document. Differently from the HTML input element using "button" in the "type" attribute, this button can contain other HTML elements like the second button in this example.
1 votes
2k views

CSS Animation Move

This allows us to move the animated element to move from one place to another.
0 votes
2k views

CSS star selector

* selector selects all the elements of the page and apply properties defined under it. If we have some properties that should be applied on all the elements, then * selector is used
0 votes
1k views

CSS Linear Transition

CSS3 transitions provide a way to control the speed of animation changes to CSS properties. Instead of having the animation changes take effect instantly, you can transition the property changes over a specified time period.
0 votes
1k views

JavaScript setInterval function

JavaScript setInterval function provides the functionality to execute the specified function after the sepcified time interval in milliseconds. Using the JavaScript setInterval function you can set the time interval to call a function again and again.
0 votes
1k views

CSS Animation with time frames

This animation allows to add time to animation effect.
2 votes
1k views

jQuery Slide

The jQuery slideUp and slideDown methods gradually change the height of the selected elements.
0 votes
1k views

JavaScript window Object

Create a new window and move new browser window.
0 votes
1k views

jQuery Mouse Event

jQuery mouse events are events that have to do with actions of the mouse. These can be a click, double-click, mouse down and more. Mouse events can be used in two different ways.
1 votes
1k views

CSS Radial Gradient

The CSS radial-gradient function creates a effect which represents a gradient of colors radiating from an origin. Radial gradients are defined by their origin and the angle, orientation, and type, a circle or an ellipse of the spreading shape.
1 votes
1k views

CSS3 Border-radius

The CSS3 border-radius property allows web developers to easily utilise rounder corners in their design elements, without the need for corner images or the use of multiple div tags.
0 votes
1k views

CSS Pseudo

CSS pseudo-classes are used to add special effects to some selectors.
0 votes
1k views

jQuery Replace Element

Using jquery manipulation methods, we can replace elements with another elements.
0 votes
1k views

jQuery Fade

The jQuery fade methods gradually change the opacity for selected elements.
0 votes
1k views

jQuery Error handling

Register a handler with jQuery to be called when Ajax requests complete with an error. Whenever an Ajax request completes with an error, jQuery triggers the ajaxError event. Any and all handlers that have been registered with the .ajaxError() method are executed at this time.
0 votes
1k views

jQuery Create Element

jQuery provides methods to manipulate documents in efficient way. Using jquery manipulation methods, we can insert element in given document. Like here we add a new element before the blue square.
1 votes
1k views

jQuery User Controlled Animation

jQuery Animate can function supports animation in different directions
0 votes
1k views

CSS Absolute Position

The HTML div element is a block level element is also nice to use for positioning around on the web page. In this example were two small boxes is position relative to the larger box.
0 votes
1k views

CSS Radial Gradient at center

The CSS radial-gradient function creates a effect which represents a gradient of colors radiating from an origin. Radial gradients are defined by their origin and the angle, orientation, and type, a circle or an ellipse of the spreading shape.
0 votes
1k views

CSS border-radius 2

You can specify the border-radius value in pixel and percentage.
0 votes
1k views

CSS Color

Colors can be applied to any HTML element. Like div, text, body ,paragraph etc.
0 votes
1k views

CSS Fonts

Using CSS font properties we can set the color, hight , width ,size and alignment of the Font.
0 votes
1k views

CSS Shadow Box

CSS box with shadow is applied with the boxes.
1 votes
1k views

CSS Multiple Classes

It is possible to add more than one class to an HTML element. Classes are written within the same attribute, with spaces separating each class. The advantage of multiple classes is that you can write a CSS rule to select either of the classes – and they both affect the same element.
0 votes
1k views

CSS Container Margin

CSS margin and padding properties are used to spacing out the elements. A margin is the space outside of the element, whereas padding is the space inside the element.
1 votes
1k views

CSS Multiple Shadows

We can apply multiple shadows of the box or text at the same HTML element.
0 votes
1k views

CSS Relative Position

Relative position specifies the position of the element within the area. It will not go outside of the containing area.In the given example the containing area is body of the page.
0 votes
1k views

Box Modal

Creating a on Margins, padding,and borders.
0 votes
1k views

CSS Fixed Position

This property makes the element fix on the page. Scrolling will not effect the position of element Please ensure the browser window is small enough for a scrollbar to appear, this fully demonstrates the fixed positioning.
0 votes
1k views

CSS enabled & disabled

These are used to apply the properties on the elements that are either enable or disable.
0 votes
1k views

CSS Container Padding

CSS padding is used to make the gap between the container and the text.
0 votes
1k views

CSS Bottom

To have the effect for bottom text we have created a master container where the position to all child elements position is relative to the master container. And we used a child container with a absolute position to bottom and left for the master container.
0 votes
1k views

jQuery Animate Properties

jQuery animate also support different properties and multiple unit types within one animation.
0 votes
1k views

CSS child selector

In CSS a parent element is an element that contains other elements. All elements that are contained within that parent are called "child" elements. Using the CSS child selector, you can define properties that only affect elements that are children of other specific elements. Every element is a child of another element except the root element, which has no parent.
0 votes
1k views

CSS Nesting

Using nesting of selectors we can specify the properties to selectors within selectors.
1 votes
1k views

CSS Float

It can sometimes be useful to have some text be aligned to the left and some text be aligned to the right on the same line. For example, in a footer, where you might want to have copyright info on the left and webmaster info on the right.
1 votes
1k views

jQuery Remove Element

Using jQuery manipulation methods, we can remove elements.
0 votes
1k views

CSS Arbitrary Linear Gradient

This gradient has arbitrary stops according to our needs.
0 votes
1k views

CSS Flexible Box Extended

The flexible box model has box-pack nad box-align properties. The box-pack property allows to fit the boxes that are in horizontal manner. The box-align property allows to fit the boxes that are in vertical manner. The box-ordinal-group property allows to set the order of the boxes manually.
0 votes
1k views

CSS 3D Transform

CSS3 allows you to format your elements using 3D transforms and here we have rotated 180 degrees around X axis.
0 votes
1k views

JavaScript Loop with break and continue

Javascript provides us the facility to break a loop in middle and also to continue the loop without executing the whole body of the loop.There are two keywords that provides these facilities: 1) break 2) continue
0 votes
1k views

CSS odd pseudo

This selects elements based on a simple provided algebraic expression (e.g. "2n" or "4n-1"). Has the ability to do things like select even/odd elements, "every third", "the first five", and things like that. CSS :odd is the same as :nth-child(odd) or :nth-child(2n+1)
0 votes
1k views

CSS even pseudo

This selects elements based on a simple provided algebraic expression (e.g. "2n" or "4n-1"). Has the ability to do things like select even/odd elements, "every third", "the first five", and things like that. CSS :even is the same as :nth-child(even) or :nth-child(2n)
0 votes
1k views

JavaScript Submit Event

This event is fired when the form is submitted. This is only works with the form element of the HTML.
0 votes
1k views

jQuery DOM Traversing and filtering

Most of the JQuery Traversal Methods do not modify the jQuery object and they are used to filter out elements from a document based on given conditions. The filter( selector ) method can be used to filter out all elements from the set of matched elements that do not match the specified selector(s).
0 votes
1k views

jQuery - Set CSS for an element

jQuery also allows us the set the property value of the CSS.
0 votes
1k views

CSS Font Attributes

Using text properties of CSS we can set the height, width , color of the text
0 votes
1k views

CSS Even Linear Gradient

Linear Gradient effect with even stops.
0 votes
1k views

CSS Dimension with percentage

This property allows us to define the height and width of the HTML elements in the percentage.
0 votes
1k views

JavaScript Browser Detection

The Navigator object contains information about the visitor's browser.
0 votes
1k views

CSS border-radius

You can specify the border-radius value in pixel and percentage.
0 votes
1k views

CSS3 Multi Columns Extended

Multi columns property allows us to define column rule and the gap between column and column fill type.
1 votes
1k views

jQuery Selectors Types

jQuery selectors allow you to select and manipulate HTML elements as a group or as a single element.