Showing posts with label CSS. Show all posts
Showing posts with label CSS. Show all posts

Wednesday, January 23, 2013

Element (center) is obsolete. Its use is discouraged in HTML5 documents


In latest version of HTML (HTML 5.0), CENTER tag is deprecated. So instead of using Tag <center>..</center>, you can use text-align:center. 'text-align' property doesn't actually aligns the division, it aligns the text content within the division.

Inline -

<div style="text-align:center">your content...</div>

Css -

.center {
  text-align:center
}

<div class="center">your content...</div>

Wednesday, January 16, 2013

Open Popup div with disabled background using Javascript


Let's see a simple HTML code for Popup div with disabled background. On clicking a particular link it will open a popup div with desire information, it can also be used as popup window. Below example shows following features -

  1. Onclick opens a popup div with disabled background
  2. Close popup div using escape button
  3. Opens popup div exactly at the center of the screen
  4. Opacity can be controlled within 

Below is the tested code, directly you can save it and see the output.