a.menu:link {color: black}
Selects:
<a class="menu" href="#">MenuItem</a>
Tag Archive for html
Selector for link tag with class
XHTML 1.0 Strict Template (DOCTYPE, charset, stylesheet)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link rel="stylesheet" type="text/css" media="all" href="" /> </head> <body> </body> </html>
Category: Uncategorized |
Tags: charset, css, doctype, doctypes, html, stylesheet, template, templates, xhtml
Dead Centre A DIV
body
{
margin: 0px
}
#horizon
{
color: white;
background-color: #0ff;
text-align: center;
position: absolute;
top: 50%;
left: 0px;
width: 100%;
height: 1px;
overflow: visible;
visibility: visible;
display: block
}
#content
{
position: absolute;
left: 50%;
width: 250px; /* Overall width of div */
height: 70px; /* Overall height of div */
top: -35px; /* half of the overall height */
margin-left: -125px; /* half of the overall width */
visibility: visible
}
add HTML tag to a string
var bits:Array = new Array();
function addHtmlTag(tf:MovieClip,indexStart:Number,indexEnd:Number,tag:String):String{
bits = new Array();
bits = getStringParts(tf,indexStart,indexEnd);
if(bits != undefined){
var newString:String = bits[0] + " <" + tag + ">" + bits[1] + " </" + tag + ">" + bits[2];
return newString;
}
}
function getStringParts(tf:MovieClip,indexStart:Number,indexEnd:Number):Array{
var wholeString:String = tf.htmlText;
var totalIndex:Number = wholeString.length;
bits.push(wholeString.substring(0,indexStart));
bits.push(wholeString.substring(indexStart,indexEnd));
bits.push(wholeString.substring(indexEnd,totalIndex));
//trace("bits: "+bits);
return bits;
}
// usage
// var newText:String = addHtmlTag(myTextField_mc, 0, 10, "b");
simple black border
style='border: 1px solid black;'
Valid XHTML 1.1 Strict Flash Embed
<div> <object type="application/x-shockwave-flash" data="header.swf" width="700" height="116"> <param name="movie" value="header.swf" /> <img src="header.gif" width="700" height="116" alt="header" /> </object> </div>
MySQL Query to HTML Table
function _mysql_result_all($result, $tableFeatures="border='1'",$nodata=" ") {
$tableDebug .= "<!--Debugging output for SQL query-->
";
echo "<table $tableFeatures>
";
$noFields = mysql_num_fields($result);
echo "<tr>
";
for ($i = 0; $i < $noFields; $i++) {
$field = mysql_field_name($result, $i);
echo " <th>$field</th>
";
}
while ($r = mysql_fetch_row($result)) {
echo "<tr>
";
foreach ($r as $column) {
echo " <td>";
if ($column == NULL) {
echo "$nodata";
} else {
echo $column;
}
echo "</td>
";
}
echo "</tr>
";
}
echo "</table>
";
echo "<!--End debug from SQL query-->
";
return $tableDebug;
}
_mysql_result_all($result);
Give headings IDs
Find: (<h[1-6])(>)(.+)(</h[1-6]>) Replace: $1 id="$3"$2$3$4 Turns <h4>Foobar</h4> into <h4 id="Foobar">Foobar</h4>