Monday, 22 April 2013

HTML Block elements



HTML Block elements


  • HTML elements can be grouped together with <div> and <span>.
  • Most HTML elements are defined as block level elements or as inline elements.
  • Block level elements normally start (and end) with a new line when displayed in a browser.
  • Examples: <h1>, <p>, <ul>, <table>

1) Inline Elements
Inline elements are normally displayed without starting a new line.
Examples: <b>, <td>, <a>, <img>

      <div> Element

  • The HTML <div> element is a block level element that can be used as a container for grouping other HTML elements.
  •  The <div> element has no special meaning. Except that, because it is a block level element, the browser will display a line break before and after it.
  • When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.
  • Another common use of the <div> element, is for document layout. It replaces the "old way" of defining layout using tables.
  •  Using tables is not the correct use of the <table> element. The purpose of the <table> element is to display tabular data.

<span> Element


  • The HTML <span> element is an inline element that can be used as a container for text.
  • The <span> element has no special meaning.
  • When used together with CSS, the <span> element can be used to set style attributes to parts of the text.


Description


  • A HTML block is a standard block used to add text or images on a site or course page. The title bar can be left blank.
  • The block is flexible and can incorporate a variety of functions and uses in the content area.
  • It has the standard Moodle HTML editor for formatting text, adding images or creating links, switching to code view and allows any valid HTML markup to be used.
  • This enables embedding video, sounds, Flash, and other files which can add unique elements to a course or site page.


Example
<html>
<body>
<div class="menu">
  <span>Main page</span>
  <span>Contents</span>
  <span>Help</span>
</div>
</body>
</html>


Display
Main page Contents Help


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More