Tag Archives: HTML

popup on hover html

<style>
#hover-text { position:relative; cursor:pointer; }
#hover-text span {
display:none; position:absolute; top:0; left:100px;
z-index:1; width:150px; padding:10px; border:1px solid #ccc;
border-radius:5px; box-shadow:4px 4px 4px #999;
}
#hover-text:hover span { display:block; }
</style>

<div id=”hover-text”>
Site Name
<span>
PHPCodez
</div>

 

Share

HTML

HyperText Markup Language (HTML) is the main markup language for web pages. HTML elements are the basic building-blocks of webpages.

HTML is written in the form of HTML elements consisting of tags enclosed in angle brackets , within the web page content. HTML tags most commonly come in pairs like, although some tags, known as empty elements, are unpaired, for example . The first tag in a pair is the start tag, the second tag is the end tag (they are also called opening tags and closing tags). In between these tags web designers can add text, tags, comments and other types of text-based content.

The purpose of a web browser is to read HTML documents and compose them into visible or audible web pages. The browser does not display the HTML tags, but uses the tags to interpret the content of the page.

HTML elements form the building blocks of all websites. HTML allows images and objects to be embedded and can be used to create interactive forms. It provides a means to create structured documents by denoting structural semantics for text such as headings, paragraphs, lists, links, quotes and other items. It can embed scripts in languages such as JavaScript which affect the behavior of HTML webpages.

Web browsers can also refer to Cascading Style Sheets (CSS) to define the appearance and layout of text and other material. The W3C, maintainer of both the HTML and the CSS standards, encourages the use of CSS over explicitly presentational HTML markup

Share

Align divs horizontally – CSS

<div style=”float:left; width:300px;”>

<div style=”float:left; width:60px;”>Test 1</div>

<div style=”float:left; width:60px;”>Test 2</div>

<div style=”float:left; width:60px;”>Test 3</div>

<div style=”float:left; width:60px;”>Test 4</div>

<div style=”float:left; width:60px;”>Test 5</div>

</div>

Share

Dynamically Add/Remove Any number of Textboxes

<?php $max_no_boxes=10; ?>
 <script type="text/javascript">
 function addnames() {
 document.getElementById("totalnames").value	=
 Number(document.getElementById("totalnames").value) +	Number(1);
 if(Number(document.getElementById("totalnames").value)>=
 Number(<?php echo $max_no_boxes ?>)){
 document.getElementById("totalnames").value=<?php echo $max_no_boxes ?>;
 document.getElementById("nameButton").style.display="none";
 }
 document.getElementById("name"+document.getElementById("totalnames").value)
 .style.display="block";
 }
 function removenames() {
 document.getElementById("name"+document.getElementById("totalnames").
 value).style.display="none";
 document.getElementById("totalnames").value	=
 Number(document.getElementById("totalnames").value) -	Number(1);
 if(Number(document.getElementById("totalnames").value)<
 Number(<?php echo $max_no_boxes ?>))
 document.getElementById("nameButton").style.display="block";
 }
 </script>

 <table>
 <tr>
 <td valign="top">Name</td>
 <td valign="top">
 <div class="project_right">
 <?php for($i=2;$i<=$max_no_boxes;$i++) { 	$nameValue	=	"name".$i; ?>
  <div style="display:<?php echo $totalnames>= $i ?"block":"none"; ?>"
  id="name<?= $i ?>">
 : <input type="text" name="name<?= $i ?>"  class="projectText"
 value="<?php echo $$nameValue ?>">
 <a href="javascript:return false;" onClick="javascript:removenames();">Remove</a>
 </div>
 <?php } ?>
 <div style="width:175px;; clear: left; float:left">:
 <input type="text" name="name1" class="projectText"
 value="<?php echo $name1 ; ?>">
 </div>
 <div style="width:20px; clear: none; float:left">
 <a id="nameButton" href="javascript:return false;"
 onClick="javascript:addnames();">Add</a>
 </div>
 <input type="hidden" id="totalnames"  name="totalnames"
 value="<?php echo $totalnames==""?1:$totalnames; ?>" />
 </div>
 </td>
 </tr>
 </table>
Share

Submit HTML form to pop up page

<script language="JavaScript" type="text/JavaScript">
	function MM_reloadPage(init) {
	if (init==true) with (navigator) {
	if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
	document.MM_pgW=innerWidth; document.MM_pgH=innerHeight;
	onresize=MM_reloadPage; }}
	else if (innerWidth!=document.MM_pgW ||
	innerHeight!=document.MM_pgH) location.reload();
	}
	MM_reloadPage(true);
	function popupWindow(pageURL,WindowName,features) { //v2.0
	window.open(pageURL,WindowName,features);
	}
</script>

<form method="post" action="test.php" target="list"
onSubmit="popupWindow('test.php','list','scrollbars=yes,width=500, height=400')">
	<input type="text" name="name">
	<input type="submit" value="Submit" name="submit">
</form>
Share

Latest tweets in your site – PHP

<?php

$username=”tppramod”; // Your Twitter username

$limit=10;//Number of tweets

if(!is_numeric($limit)){$limit = 10;}

$xml = simplexml_load_file(‘http://search.twitter.com/search.atom?q=from%3A’.urlencode($username));?>

<table>

<?php for($i=0;$i<$limit;$i++){

if(empty($xml->entry[$i]->content)) break;

$attr = $xml->entry->link[1]->attributes();

?>

<tr> <td> <img src=”<?php echo $attr[‘href’]; ?>” /> </td> <td style=” font-size:12px;”> <?php echo  $xml->entry[$i]->content; ?> </td> </tr>

<?php } ?>

</table>

Share