p (HTML4 & HTML5)

Defines a paragraph of text.

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 ??
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
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: 'p'

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
1 votes
13k views

HTML Format

When you begin to place more and more elements onto your web site, it will become necessary to make minor changes to the formatting of those elements.
1 votes
12k views

CSS nth-child

The nth child selector is used to select the specified element of the page.
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.
10 votes
11k views

CSS Basic Styling

CSS is the acronym for: ‘Cascading Style Sheets’. CSS is an extension to basic HTML that allows you to style your web pages.
1 votes
11k views

CSS Inline Boxes

In this example the inline display is used to merge the two paragraphs of example text together.
2 votes
11k views

jQuery - Get CSS information

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

CSS Pseudo on link tag

In this example, a hyperlink with a destination of "#" is set to display different colouring for different properties.
2 votes
11k views

HTML Link Types

Links are found in nearly all Web pages. Links allow users to click their way from page to page. Examples using the href and target example.
2 votes
11k views

CSS on HTML

Extend the standard HTML element styles by CSS.
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.
2 votes
11k views

Html Textbox

The contents are interpreted as text only; HTML markup is ignored. The user can type (theoretically) unlimited amounts of text into the textarea field. In reality the browser sets the limit.
1 votes
11k views

CSS Absolute

With absolute positioning, an element can be placed anywhere on a page. In this example the heading has been placed 100px from the left of the page and 150px from the top of the page. It will remain in this position.
1 votes
11k views

jQuery Plugin Introduction

By extending jQuery, you create reusable components that can be used on any web page. Your code is encapsulated and there is less risk that you will use the same function names elsewhere.
2 votes
10k views

CSS @font-face

CSS3 allows user to use the font that are even not installed on his/her own computer. The fonts that that resides on the server can be used by CSS3 @font-face.
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 Text Align

This example uses an Internal CSS Style Sheet to make the heading centred, along with the main text. It moves the example date to the right hand side.
1 votes
10k views

HTML5 canvas

The <canvas> tag is used to draw graphics, on the fly, via scripting (usually JavaScript). The <canvas> tag is only a container for graphics, you must use a script to actually draw the graphics.
3 votes
10k views

HTML & CSS

Styling HTML elements with CSS (Cascading Style Sheet). CSS was introduced together with HTML 4, to provide a better way to style HTML elements.
0 votes
10k views

CSS Border Style

In this example two lines of text have been bordered using thick and medium widths. They have a "border-style" of "solid" to ensure the borders display correctly.
1 votes
10k views

HTML Image

Images with title and borders
4 votes
10k views

HTML5 geoLocation

The HTML5 Geolocation API is used to get the geographical position of a user. NOTE: Since this can compromise user privacy, the position is not available unless the user approves it.
0 votes
10k views

JavaScript Click and Mouse Events

Javascript Events are the actions which are detected by the javascript when they are fired.
0 votes
10k views

CSS Grouping

Grouping is the method to group the selectors which have same property. It minimizes the code. We write the selectors by separating them using comma.
0 votes
10k views

CSS Text Color

Shows how to set text colors on different elements.
2 votes
10k views

jQuery Animate Introduction

jQuery animate method is very powerful API to manipulate html elements and add animation functionality. The use of animate function is very simple.
4 votes
9k views

CSS Attributes

In addition to setting a style for a HTML element, CSS allows you to specify your own selectors called "id" and "class". "id" and "class" are attributes to most HTML elements.
1 votes
9k views

HTML Script

The <script> tag is used to define a client-side script, such as a JavaScript. The script element either contains scripting statements or it points to an external script file through the src attribute.
1 votes
9k views

HTML Entities

Some characters are reserved in HTML. It is not possible to use the less than (<) or greater than (>) signs in your text, because the browser will mix them with tags. To actually display reserved characters, we must use character entities in the HTML source code.
1 votes
9k views

CSS selectors

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

jQuery Event Introduction

Introduction to jQuery and how to attach a handler to one or more events for all elements that match the selector.
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
1 votes
9k views

Create JavaScript Cookie

Cookies are stored by the web browser. They allow you to store particular information about a user and retrieve it every time they visit your pages. Each user has their own unique set of cookies
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.
4 votes
8k views

HTML5 audio

The <audio> tag defines sound, such as music or other audio streams. Tip: Any text inside the between <audio> and </audio> will be displayed in browsers that do not support audio.
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.
2 votes
8k views

JavaScript Required Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example has a required validation on the input box.
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.
3 votes
8k views

JavaScript if and else

JavaScript if…else is a conditional statement that is used to check wether a condition is true or false to take a decision.
2 votes
6k views

CSS Animation Loop

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

CSS Background Color by different syntax

This example the a line of text has been set a background color. Each paragraph is setting color by hex, rgb or color name.
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

HTML5 svg line & polyline

SVG stands for Scalable Vector Graphics and it is a language for describing 2D-graphics and graphical applications in XML and the XML is then rendered by an SVG viewer. SVG is mostly useful for vector type diagrams like Pie charts, Two-dimensional graphs in an X,Y coordinate system etc.
3 votes
2k views

HTML Body

The <body> element defines the body of the HTML document. The element has a start tag <body> and an end tag </body>.
0 votes
2k views

HTML Expires

Use the meta tag to make the cache for your web page expire. If you are looking for a way to stop Google from caching your site, the Meta Expires tag will not do this for you. To stop Google to caching your site use following meta tag: <meta http-equiv="cache-control" content="no-cache">
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.
1 votes
2k views

HTML5 wbr

The Word Break Opportunity (<wbr></wbr>) specifies where in a text it would be ok to add a line-break. Tip: When a word is too long, or you are afraid that the browser will break your lines at the wrong place, you can use the <wbr> element to add word break opportunities.
0 votes
2k views

HTML Paragraphs

HTML paragraphs are defined with the <p> tag. This element is used to define a paragraph of text.
2 votes
2k views

HTML5 progress

Represents the completion progress of a task. Tip: Use the <progress> tag in conjunction with JavaScript to display the progress of a task.
0 votes
2k views

CSS @font-face with Multiple Fonts

CSS3 allows user to use the font that are even not installed on his/her own computer. The fonts that that resides on the server can be used by CSS3 @font-face.
1 votes
2k views

HTML5 time

The <time> tag defines either a time (24 hour clock), or a date in the Gregorian calendar, optionally with a time and a time-zone offset. This element can be used as a way to encode dates and times in a machine-readable way
1 votes
2k views

HTML5 Canvas Image

The drawImage method allows you to insert other images (img and canvas elements) into your canvas context. To draw an image using HTML5 Canvas, we can use the drawImage() method which requires an image object and a destination point. The destination point is relative to the top left corner of the image.
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 Text Colors

This example uses an internal CSS Style Sheet sets the body text to blue, and changes H1 to green (#9AFE2E) and H2 to red (#FF0000).
1 votes
2k views

HTML5 section, header, and article tags

Any given web page or article could have many sections. For example, a homepage could have a section for introducing the company, another section for news items, and another section for contact information.
0 votes
2k views

Missing tags

In this example we forgot the end tags for our HTML paragraph tags (</p>). Some HTML tags might display correctly in some browers even if you forget the end tag.
1 votes
2k views

CSS Syntax

CSS syntax is as selector{property:value;}. Here selector is the element on which we want to apply the CSS. Property may be height , width ,color etc. The value may be in percent , numbers or letters.
0 votes
2k views

jQuery DOM Traversing and locating elements

Jquery traversing methods can be used to locate all the descendent elements of a particular type of elements.
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
2k views

My second page

A basic web page with some text, paragraph, bold text and line breaks.
0 votes
1k views

HTML Element with JavaScript code

<a> tag has a "onclick" event that is triggered when clicked. This is a good place to use JavaScript to build nire interactivity into your web page.
0 votes
1k views

JavaScript Keyboard Events

This event are fired when a key is pressed. IE 8 and earlier use event.keyCode to retrieve the key that was pressed down, while Firefox/Chrome/Safari/Opera use event.which.
1 votes
1k views

CSS Class and ID

CSS class selector is defined using "."(dot) for example ".class1". The class selector can be used more than one in same document. The ID selector is defined using "#" (hash), for example "#id1". The id selector can only be used once in same document.
1 votes
1k views

HTML Href

Href (Hypertext Reference) is an HTML attribute of an anchor (link) tag that requires a valid URL in order to properly direct a user to a different location on current webpage or external webpage.
0 votes
1k views

JavaScript Try and Catch inside a function

Javascript Try…catch statement to check if there is errors in a block of code.
1 votes
1k views

CSS Basic Formatting

This example uses a basic internal CSS Style Sheet sets the page background to green (#9AFE2E), and then we add CSS attributes for <h1> and <p> tags.
0 votes
1k views

HTML Radio buttons and Checkboxes

Form containing two radio buttons and two checkboxes. Note: The name attribute is used to group the radio buttons and checkboxes into groups.
1 votes
1k views

List Columns

Unordered or ordered lists can be arranged in two, three, or more columns using nothing more than css. We force the list to break at the right point. If We want two columns, you need to float the list items left and set them at 50% width and for three columns would require a width of 33% and floated left, four would be 25% and so on.
1 votes
1k views

Javascript Email Address Validation

JavaScript validation are client side scrips that is used to reduce the server load because all validation are check on client browser. This example validates the input matches a valid e-mail address with a regular expression.
0 votes
1k views

CSS Text

Styling HTML elements with font-family, color, and font-size properties defines the font, color, and size of the text in an element.
0 votes
1k views

HTML image link

If you want to make an image work as a link, the method is exactly the same as with texts. You simply place the <a href> and the </a> tags on each side of the image.
0 votes
1k views

HTML5 Output

Perform a calculation and show the result in an <output> element
1 votes
1k views

jQuery Selectors Advanced

The jQuery nth-child is used to select all elements that are ntg-child of of their parent. The nth-child(n) is “1-indexed”, meaning the “n” is counting starts at 1. Because jQuery's implementation of :nth-child(n) is strictly derived from the CSS specification, the value of n is "1-indexed", meaning that the counting starts at 1. For all other selector expressions, however, jQuery follows JavaScript's "0-indexed" counting.
0 votes
1k views

CSS Display block

CSS display block property displays the HTML elements in the block.
0 votes
1k views

JavaScript window Object

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

HTML Script

HTML script tag is used to define an section with javascript. In our example we have created two javascript function in the header. Note that each link shows a different way of calling the function.
0 votes
1k views

HTML Text Format

Examples of text-specific code that you can create by using HTML formatting tags.
1 votes
1k views

CSS Basics Indroduction

CSS stands for Cascading Stylesheet. This add new look to the basic HTML and manages the HTML according to our needs.
0 votes
1k views

CSS Pseudo

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

CSS Align

The text-align property specifies the horizontal alignment of text in an element.
0 votes
1k views

jQuery Replace Element

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

CSS RGB Color

CSS colors can be appied radomly using RGB combination (Red,Green,Blue).
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 and Selector

By using the style element you can map CSS attributes to class attribute used on HTML elements. For advanced examples on this topic please see advanced HTML.
0 votes
1k views

jQuery Animate

The jQuery animate method has a complete method we can supply with callback function that is fired once the animation is complete. This can be useful for stringing different animations together in sequence like this example.
0 votes
1k views

HTML5 embed

The <embed> tag defines a container for an external application or interactive content (a plug-in).
0 votes
1k views

CSS Layers Overlapping

This example uses "z-index:100" to place an image above the text. Try to change z-index to -1 and see the image fall behind the text.
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.
1 votes
1k views

CSS Border

Using CSS border we can set style, color, width of the borders of an HTML 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.
0 votes
1k views

HTML Password

Password Field <input type="password" /> defines a password field:
1 votes
1k views

JavaScript onfocus Event

JavaScript event that triggers when object gets focus.
0 votes
1k views

CSS on Text

Use CSS to set the font of a text
0 votes
1k views

CSS Font

This example shows you three lines of text, two controlled by a class. Each class has a different font applied. The fonts are applied using an internal Style Sheet. The "Example Fonts" is using a simple <h1> tag.
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

CSS Border Color

This example two lines of text have been bordered using red and green colouring. They have a "border-style" of "solid" to ensure the borders display correctly. Without setting the style, the color change will not work.
0 votes
1k views

CSS Margin

This example shows you how to use an internal CSS StyleSheet to apply margin options. The top line has no margin, whereas the second line of text has a margin on both sides of 50px.
2 votes
1k views

HTML Image Background

Background image inside a paragraph.
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 Padding

This example shows you how to use an internal CSS Style Sheet to apply padding options. The top line of text has no padding, whereas the second line of text has 25px padding at the top and bottom, and 50px padding on either side.
0 votes
1k views

HTML index

Every website is built inside directories on a Web server. And each Web page is a separate file on that Web server. But sometimes, when you go to a URL, there is no file listed in the URL. For example: http://www.webgrid.com But there is still a file that the Web server needs to serve in order for that URL to display anything other than an error page. This file is the default page for that directory. On most Web servers, the default page in a directory is named "index.html".
0 votes
1k views

CSS @font-face with font-weight

CSS3 allows user to use the font that are even not installed on his/her own computer. The fonts that that resides on the server can be used by CSS3 @font-face.
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

JavaScript Print method

Opens a dialog window for printing the current web page.
0 votes
1k views

CSS Dimension with max width and min height

This property allows us to define the maximum and minimum hight and width the elements of the HTML.
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

JavaScript Random

JavaScript random method returns a random number between 0 and 1.
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.
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

Complete Web Page Example

The HTML head Element The head element is a container for all the head elements. Elements inside <head> can include scripts, instruct the browser where to find style sheets, provide meta information, and more. The following tags can be added to the head section: <title>, <base>, <link>, <meta>, <script>, and <style>.
0 votes
1k views

JavaScript nested if and else

This statement allows us to select one statement among many statements.It is also called nested if….else.
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 Border Styles

In this example a line of text has been bordered using different border styles.
0 votes
1k views

CSS Text Align

Text can be centered, or aligned to the left or right, or justified. When text-align is set to "justify", each line is stretched so that every line has equal width, and the left and right margins are straight (like in magazines and newspapers).
1 votes
1k views

jQuery Element manipulation

jQuery contains powerful methods (functions) for changing and manipulating HTML elements and attributes. Click on the button to see jQuery hiding the paragraphs.
0 votes
1k views

CSS Absolute Position

CSS position property allows us to set an absolute position to an element (relative to it's environment). We can set the position of an element using the top, right, bottom, and left properties.
0 votes
1k views

CSS Border Width

In this example two lines of text we borders at 15px and 10px width. They have a "border-style" of "solid" to ensure the borders display correctly.
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 Vertical Align

The vertical-align property sets the vertical alignment of an element.
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

JavaScript Browser Detection

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

JavaScript DOM Attribute count

Count number of attributes that exists for the button.
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.
0 votes
1k views

JavaScript DOM setAttribute

We are here using Core DOM setAttribute method we set the value of input type text to button.
0 votes
1k views

JavaScript Loading Order

The HTML paragraph element is written on the web page before the dynamic content from the script. That is because the script tag is after the paragraph tag. If you move the HTML script element to the "head" tag you will see the dynamic text is written first!
0 votes
1k views

JavaScript function with return value

If you provide a return statement inside a function you may specify the value that you would like to return from the function. So, functions that are going to return a value must use the return statement.
0 votes
1k views

Delete JavaScript Cookie

Enables you to remove a client cookie with JavaScript. We remove the cookie by setting the expiration date for the cookie back in time.
0 votes
7 views

Aside HTML5 element 123

Represents a section of a page consisting of content that is tangentially related to the content around the aside element, and which could be considered separate from that content. Such sections are often represented as sidebars in printed typography. 12345
0 votes
0 views

colorful texts

Shows how to set text colors on different elements.12345