• If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • Stop wasting time looking for files and revisions. Connect your Gmail, DriveDropbox, and Slack accounts and in less than 2 minutes, Dokkio will automatically organize all your file attachments. Learn more and claim your free account.



Page history last edited by PBworks 14 years, 3 months ago




An id is an HTML property useful for defining an individual element. It is set as follows:


<tag id="label">...</tag>


where "tag" is any HTML tag (div, span, table, etc.) and "label" is the unique name for that element. NOTE: That means that only ONE element can have any given id.


The id does not affect the HTML of the page in any way. Instead, it is an identifier to be used in CSS or Javascript, as shown below.


CSS Application


The main use of the id for most people is to modify specific elements of a PBwiki-generated HTML document. For example, the user content area of a wiki page is roughly defined as follows:


<div id="displaycontent"
   <div id="SideBar">
      ...SideBar content..

   ...page content...



To modify the styles for these pages, one sets the selector for the CSS declaration to the id, preceded by a # (pound sign), as follows:


#displaycontent { background:#CCCCCC; }


That declaration says, "set the background of the element with the id 'displaycontent' to the color #CCCCCC (light gray)."


Javascript Application


For dynamic content, you can use Javascript to access the element and change its styles. Although this is mostly out of the scope of this wiki, here is a simple example:


<script type="text/javascript">
document.getElementById("SideBar").style.width = '150px';


This tells the Javascript interpreter to find the element with the specified id and then to set its width property.


See Also


Comments (0)

You don't have permission to comment on this page.