Showing posts with label html. Show all posts
Showing posts with label html. Show all posts
Friday, January 15, 2010

stuff.co.nz Logo by HTML+CSS

It's Friday afternoon, I am feeling bored, so spent half hour to built stuff.co.nz logo by pure html+css. It was heaps of fun. Here is the preview and my code, guess left one or right one? From you memory,  don't look at stuff.co.nz!



HTML

<div id="logo">
 <span id="text">stuff<span class="dot first">.</span><span class="domain">co</span><span class="dot">.</span><span class="domain">nz</span></span>
 <ul><li id="r"></li><li id="y"></li><li id="g"></li><li id="b"></li><li id="p"></li></ul>
 </div>

CSS

#logo{font-family:tahoma;font-weight:bold; width:235px;}
 #text{font-size:62px;}
 .dot{font-family:Georgia; font-size:36px; letter-spacing:-2px;}
 .first{margin-left:-7px;}
 .domain{font-size:32px; letter-spacing:-1px;}
 ul{margin: -6px 0 0; list-style:none; padding:0}
 li{float:left; width:45px; height:10px;}
 #r{background-color:#C7221F}
 #y{background-color:#F59900}
 #g{background-color:#007C47}
 #b{background-color:#007DCD}
 #p{background-color:#9C1A87}
Tuesday, December 8, 2009

How to use HTML Label Tag

One of our readers who enjoys the stuff.co.nz "Opinion Polls", pointing out there's one thing that he find inconsistent - the HTML we are using to provide the poll options does not use the LABEL tag. This is a useful tag that allows a user to click on the text associated with a radio button, with the same effect as if they had clicked on the actual button itself.

First of all, I should say thank you to this user, he is awesome.

It's a usability issue, I actually noticed this issue the other day. But I thought like 99% users would click on the radio button or check box rather than the text, so I didn't bring up this issue. This is something minor but we should do to keep Stuff.co.nz a cutting edge website impression for our users.

Now, I want to detail the mystery of label tag


Friday, November 13, 2009

How to use HTML dl, dt, dd tags

Many web developers would love to create web design using table tags. In fact, by using HTML dl, dt, dd tags, you will save on writing more codes and add more semantic value to the content. Whereas table are best use for tabular data, and should not be use in listing data, web form or web layout.

If you are still creating list data using table, look below and compare on how to make your life easier with HTML dl, dt, dd tags.


It may both look identical, but look closely behind the codes.

Friday, July 17, 2009

HTML Character set and special characters

Table of printable Latin-1 Character codes
Characters of the iso-latin1 character set
© Copyright W3C out=>

Special characters

If you need a to use a special character, like an accented character or a currency sign, you have to use a special notation. There are two ways to use these special characters:
  1. Use the decimal representation, in the format &#nnn;, where nnn is the decimal code of the character.
  2. Use a character entity, in the format &ccc;, where ccc is the character string that represents the specific character.

HTML 4.0 supports three sets of special characters:

ISO 8859-1 (Latin-1) characters
Decimal Character Example Explanation
&#160;&nbsp; no-break space
&#161;&iexcl; ¡inverted exclamation mark
&#162;&cent; ¢cent sign
&#163;&pound; £pound sign
&#164;&curren;¤currency sign
&#165;&yen; ¥yen sign = yuan sign
&#166;&brvbar;¦broken bar = brolen vertical bar
&#167;&sect; §section sign
&#168;&uml; ¨diaeresis = spacing diaeresis
&#169;&copy; ©copyright sign
&#170;&ordf; ªfeminine ordinal indicator
&#171;&laquo; «left-pointing double angle quotation mark = left pointing guillemet
&#172;&not; ¬not sign = discretionary hyphen
&#173;&shy; ­soft hyphen = discretionary hyphen
&#174;&reg; ®registered sign = registered trade mark sign
&#175;&macr; ¯macron = spacing macron = overline = APL overbar
&#176;&deg; °degree sign
&#177;&plusmn;±plus-minus sign = plus-or-minus sign
&#178;&sup2; ²superscript two = superscript digit two = squared
&#179;&sup3; ³superscript three = superscript digit three = cubed
&#180;&acute; ´acute accent = spacing acute
&#181;&micro; µmicro sign
&#182;&para; pilcrow sign = paragraph sign
&#183;&middot;·middle dot = Georgian comma = Greek middle dot
&#184;&ccedil;¸cedilla = spacing cedilla
&#185;&sup1; ¹superscript one = superscript digit one
&#186;&ordm; ºmasculine ordinal indicator
&#187;&raquo; »right-pointing double angle quotation mark = right pointing guillemet
&#188;&frac14;¼vulgar fraction one quarter = fraction one quarter
&#189;&frac12;½vulgar fraction one half = fraction one half
&#190;&frac34;¾vulgar fraction three quarters = fraction three quarters
&#191;&iquest;¿inverted question mark = turned question mark
&#192;&Agrave;Àlatin capital letter A with grave = latin capital letter A grave
&#193;&Aacute;Álatin capital letter A with acute
&#194;&Acirc; Âlatin capital letter A with circumflex
&#195;&Atilde;Ãlatin capital letter A with tilde
&#196;&Auml; Älatin capital letter A with diaeresis
&#197;&Aring; Ålatin capital letter A with ring above = latin capital letter A ring
&#198;&AElig; Ælatin capital letter AE = latin capital ligature AE
&#199;&Ccedil;Çlatin capital letter C with cedilla
&#200;&Egrave;Èlatin capital letter E with grave
&#201;&Eacute;Élatin capital letter E with acute
&#202;&Ecirc; Êlatin capital letter E with circumflex
&#203;&Euml; Ëlatin capital letter E with diaeresis
&#204;&Igrave;Ìlatin capital letter I with grave
&#205;&Iacute;Ílatin capital letter I with acute
&#206;&Icirc; Îlatin capital letter I with circumflex
&#207;&Iuml; Ïlatin capital letter I with diaeresis
&#208;&ETH; Ðlatin capital letter ETH
&#209;&Ntilde;Ñlatin capital letter N with tilde
&#210;&Ograve;Òlatin capital letter O with grave
&#211;&Oacute;Ólatin capital letter O with acute
&#212;&Ocirc; Ôlatin capital letter O with circumflex
&#213;&Otilde;Õlatin capital letter O with tilde
&#214;&Ouml; Ölatin capital letter O with diaeresis
&#215;&times; ×multiplication sign
&#216;&Oslash;Ølatin capital letter O with stroke = latin capital letter O slash
&#217;&Ugrave;Ùlatin capital letter U with grave
&#218;&Uacute;Úlatin capital letter U with acute
&#219;&Ucirc; Ûlatin capital letter U with circumflex
&#220;&Uuml; Ülatin capital letter U with diaeresis
&#221;&Yacute;Ýlatin capital letter Y with acute
&#222;&THORN; Þlatin capital letter THORN
&#223;&szlig; ßlatin small letter sharp s = ess-zed
&#224;&agrave;àlatin small letter a with grave = latin small letter a grave
&#225;&aacute;álatin small letter a with acute
&#226;&acirc; âlatin small letter a with circumflex
&#227;&atilde;ãlatin small letter a with tilde
&#228;&auml; älatin small letter a with diaeresis
&#229;&aring; ålatin small letter a with ring above = latin small letter a ring
&#230;&aelig; ælatin small letter ae = latin small ligature ae
&#231;&ccedil;çlatin small letter c with cedilla
&#232;&egrave;èlatin small letter e with grave
&#233;&eacute;élatin small letter e with acute
&#234;&ecirc; êlatin small letter e with circumflex
&#235;&euml; ëlatin small letter e with diaeresis
&#236;&igrave;ìlatin small letter i with grave
&#237;&iacute;ílatin small letter i with acute
&#238;&icirc; îlatin small letter i with circumflex
&#239;&iuml; ïlatin small letter i with diaeresis
&#240;&eth; ðlatin small letter eth
&#241;&ntilde;ñlatin small letter n with tilde
&#242;&ograve;òlatin small letter o with grave
&#243;&oacute;ólatin small letter o with acute
&#244;&ocirc; ôlatin small letter o with circumflex
&#245;&otilde;õlatin small letter o with tilde
&#246;&ouml; ölatin small letter o with diaeresis
&#247;&divide;÷division sign
&#248;&oslash;ølatin small letter o with stroke = latin small letter o slash
&#249;&ugrave;ùlatin small letter u with grave
&#250;&uacute;úlatin small letter u with acute
&#251;&ucirc; ûlatin small letter u with circumflex
&#252;&uuml; ülatin small letter u with diaeresis
&#253;&yacute;ýlatin small letter y with acute
&#254;&thorn; þlatin small letter thorn with
&#255;&yuml; ÿlatin small letter y with diaeresis


Symbols, mathematical symbols, and Greek letters

The character entity references in this section produce characters that may be represented by glyphs in the widely available Adobe Symbol font, including Greek characters, various bracketing symbols, and a selection of mathematical operators such as gradient, product, and summation symbols.
Note from HTML 4.0 :

This entity set contains all the letters used in modern Greek. However, it does not include Greek punctuation, precomposed accented characters nor the non-spacing accents (tonos, dialytika) required to compose them. There are no archaic letters, Coptic-unique letters, or precomposed letters for Polytonic Greek. The entities defined here are not intended for the representation of modern Greek text and would not be an efficient representation; rather, they are intended for occasional Greek letters used in technical and mathematical works.

Symbols, mathematical symbols, and Greek letters
Decimal Character Example Explanation
&#402; &fnof; ƒ latin small f with hook = function = florin
&#913; &Alpha; Α greek capital letter alpha
&#914; &Beta; Β greek capital letter beta
&#915; &Gamma; Γ greek capital letter gamma
&#916; &Delta; Δ greek capital letter delta
&#917; &Epsilon; Ε greek capital letter epsilon
&#918; &Zeta; Ζ greek capital letter zeta
&#919; &Eta; Η greek capital letter eta
&#920; &Theta; Θ greek capital letter theta
&#921; &Iota; Ι greek capital letter iota
&#922; &Kappa; Κ greek capital letter kappa
&#923; &Lambda; Λ greek capital letter lambda
&#924; &Mu; Μ greek capital letter mu
&#925; &Nu; Ν greek capital letter nu
&#926; &Xi; Ξ greek capital letter xi
&#927; &Omicron; Ο greek capital letter omicron
&#928; &Pi; Π greek capital letter pi
&#929; &Rho; Ρ greek capital letter rho
&#931; &Sigma; Σ greek capital letter sigma
&#932; &Tau; Τ greek capital letter tau
&#933; &Upsilon; Υ greek capital letter upsilon
&#934; &Phi; Φ greek capital letter phi
&#935; &Chi; Χ greek capital letter chi
&#936; &Psi; Ψ greek capital letter psi
&#937; &Omega; Ω greek capital letter omega
&#945; &alpha; α greek small letter alpha
&#946; &beta; β greek small letter beta
&#947; &gamma; γ greek small letter gamma
&#948; &delta; δ greek small letter delta
&#949; &epsilon; ε greek small letter epsilon
&#950; &zeta; ζ greek small letter zeta
&#951; &eta; η greek small letter eta
&#952; &theta; θ greek small letter theta
&#953; &iota; ι greek small letter iota
&#954; &kappa; κ greek small letter kappa
&#955; &lambda; λ greek small letter lambda
&#956; &mu; μ greek small letter mu
&#957; &nu; ν greek small letter nu
&#958; &xi; ξ greek small letter xi
&#959; &omicron; ο greek small letter omicron
&#960; &pi; π greek small letter pi
&#961; &rho; ρ greek small letter rho
&#962; &sigmaf; ς greek small letter final sigma
&#963; &sigma; σ greek small letter sigma
&#964; &tau; τ greek small letter tau
&#965; &upsilon; υ greek small letter upsilon
&#966; &phi; φ greek small letter phi
&#967; &chi; χ greek small letter chi
&#968; &psi; ψ greek small letter psi
&#969; &omega; ω greek small letter omega
&#977; &thetasym; ϑ greek small letter theta symbol
&#978; &upsih; ϒ greek upsilon with hook symbol
&#982; &piv; ϖ greek pi symbol
&#8226;&bull; bullet = black small circle
&#8230;&hellip; horizontal ellipsis = three dot leader
&#8242;&prime; prime = minutes = feet
&#8243;&Prime; double prime = seconds = inches
&#8254;&oline; overline = spacing overscore
&#8260;&frasl; fraction slash
&#8472;&weierp; script capital P = power set = Weierstrass p
&#8465;&image; blackletter capital I = imaginary part
&#8476;&real; blackletter capital R = real part symbol
&#8482;&trade; trade mark sign
&#8501;&alefsym; alef symbol = first transfinite cardinal
&#8592;&larr; leftwards arrow
&#8593;&uarr; upwards arrow
&#8594;&rarr; rightwards arrow
&#8595;&darr; downwards arrow
&#8596;&harr; left right arrow
&#8629;&crarr; downwards arrow with corner leftwards = carriage return
&#8656;&lArr; leftwards double arrow
&#8657;&uArr; upwards double arrow
&#8658;&rArr; rightwards double arrow
&#8659;&dArr; downwards double arrow
&#8660;&hArr; left right double arrow
&#8704;&forall; for all
&#8706;&part; partial differential
&#8707;&exist; there exists
&#8709;&empty; empty set = null set = diameter
&#8711;&nabla; nabla = backward difference
&#8712;&isin; element of
&#8713;&notin; not an element of
&#8715;&ni; contains as member
&#8719;&prod; n-ary product = product sign
&#8721;&sum; n-ary sumation
&#8722;&minus; minus sign
&#8727;&lowast; asterisk operator
&#8730;&radic; square root = radical sign
&#8733;&prop; proportional to
&#8734;&infin; infinity
&#8736;&ang; angle
&#8743;&and; logical and = wedge
&#8744;&or; logical or = vee
&#8745;&cap; intersection = cap
&#8746;&cup; union = cup
&#8747;&int; integral
&#8756;&there4; therefore
&#8764;&sim; tilde operator = varies with = similar to
&#8773;&cong; approximately equal to
&#8776;&asymp; almost equal to = asymptotic to
&#8800;&ne; not equal to
&#8801;&equiv; identical to
&#8804;&le; less-than or equal to
&#8805;&ge; greater-than or equal to
&#8834;&sub; subset of
&#8835;&sup; superset of
&#8836;&nsub; not a subset of
&#8838;&sube; subset of or equal to
&#8839;&supe; superset of or equal to
&#8853;&oplus; circled plus = direct sum
&#8855;&otimes; circled times = vector product
&#8869;&perp; up tack = orthogonal to = perpendicular
&#8901;&sdot; dot operator
&#8968;&lceil; left ceiling = apl upstile
&#8969;&rceil; right ceiling
&#8970;&lfloor; left floor = apl downstile
&#8971;&rfloor; right floor
&#9001;&lang; left-pointing angle bracket = bra
&#9002;&rang; right-pointing angle bracket = ket
&#9674;&loz; lozenge
&#9824;&spades; black spade suit
&#9827;&clubs; black club suit = shamrock
&#9829;&hearts; black heart suit = valentine
&#9830;&diams; black diamond suit

Markup-significant and internationalization characters

The character entity references in this section are for escaping markup-significant characters, for denoting spaces and dashes. Other characters in this section apply to internationalization issues such as the disambiguation of bidirectional text.

Markup-significant and internationalization characters
Decimal Character Example Explanation
&#34; &quot; " quotation mark = APL quote
&#38; &amp; & ampersand
&#60; &lt; < less-than sign
&#62; &gt; > greater-than sign
&#338; &OElig; Œ latin capital ligature OE
&#339; &oelig; œ latin small ligature oe
&#352; &Scaron; Š latin capital letter S with caron
&#353; &scaron; š latin small letter s with caron
&#376; &Yuml; Ÿ latin capital letter Y with diaeresis
&#710; &circ; ˆ modifier letter circumflex accent
&#732; &tilde; ˜ small tilde
&#8194;&ensp; en space
&#8195;&emsp; em space
&#8201;&thinsp; thin space
&#8204;&zwnj; zero width non-joiner
&#8205;&zwj; zero width joiner
&#8206;&lrm; left-to-right mark
&#8207;&rlm; right-to-left mark
&#8211;&ndash; en dash
&#8212;&mdash; em dash
&#8216;&lsquo; left single quotation mark
&#8217;&rsquo; right single quotation mark
&#8218;&sbquo; single low-9 quotation mark
&#8220;&ldquo; left double quotation mark
&#8221;&rdquo; right double quotation mark
&#8222;&bdquo; double low-9 quotation mark
&#8224;&dagger; dagger
&#8225;&Dagger; double dagger
&#8240;&permil; per mille sign
&#8249;&lsaquo; single left-pointing angle quotation mark
&#8250;&rsaquo; single right-pointing angle quotation mark
&#8364;&euro; euro sign
Wednesday, June 3, 2009

SEO Tips: Effective HEADING tags H1 H2 H3

Similar to how newspapers and magazines use headings and sub-headings to help readers, websites can use special tags in their HTML. These tags not only help human readers read the content, they also help search engine spiders better understand the content on a page and what is most important. It is generally a good idea to use heading tags to help signal to the search engines, what the web page is about. If you are concerned about SEO, then you will want your headings to be as descriptive… within reason.

Search engines such as Google pay special attention to your page’s tag and how much it relates to your content - remember SEO rule number one: if you don’t write it, Google can’t find it! <h1> <h2> <h3> they're held in high regard for SE.

I run through www.stuff.co.nz with website.grader.com, the report tells me all the second level headers H2 and third level headers H3 found by search engines. Obviously, some of the titles within H2 H3 are not the related content which we want to provide to readers, some of the headlines we want to provide to readers are not found by search engine. see the example below:




From the examples we can see, the content in red boxes should be stripped from heading tags, the titles in yellow boxes should be wrapped by heading tags.

I did the same task to www.nytimes.com/, they are doing extremely well.
Wednesday, March 11, 2009

IE family does not support display: none on span in ul li

I just discover that IE 6 & 7 are not following the display: none; rule in the span inside the li. I wonder where else has the same problem.

Here is the code example:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> new document </title>
<style type="text/css">
* {
margin: 0;
padding: 0;
}

ul {
list-style: none;
width: 100px;
background: blue;
}

ul li {
width: 100px;
height: 20px;
background: green;
border: 1px solid red;
Vertical-align: top
}

ul li span {
display: none;
}
</style>
</head>

<body>
<div id="pagewrap">
<ul><li><span>one</span></li>
<li><span>two</span></li>
<li><span>three</span></li>
<li><span>four</span></li>
<li><span>five</span></li>
</ul>
</div>
</body>
</html>

So as you can see in IE it adds a gap between the li tags even thought its told to ignore the span and its content. I have found ways to make it work all listed below

1. Set ul li to float: left; <-- but maybe you dont want the ul li to be floated so that doesnt work -->

2. Set the ul li span to display: inline;margin:-500px; <--- but then you have to add overflow: hidden for ie6 to be truelly happy, and just doesnt seem right

3. Similar to 2 with the same issues but using text-indent: -5000px; on the ul li a tag again just doesnt seem right.

4. This seems to be the best solution that I have found and going to look into why a little more is to set the ul li to Vertical-align: top; or Vertical-align: bottom;