A border style to look like a button.
A neon glow menu.
A right border change on :hover.
Text movement on :hover.
Border art to indicate the link on :hover.
Additional link text on :hover.
A shadow added on :hover.
Indented text on :hover.
Value | Description |
length | Defines a fixed padding (in pixels, pt, em, etc.) |
% | Defines a padding in % of the containing element |
Common Names | Rare Names | |||||
! | exclamation mark bang pling excl not shriek |
| ||||
" | quotation marks quote double quote |
| ||||
# |
|
| ||||
& | ampersand amp amper and and sign | address reference andpersand bitand background pretzel | ||||
' | apostrophe single quote quote |
| ||||
( ) | opening / closing parenthesisleft / right paren left / right parenthesis left / right open / close open / close paren paren / thesis | so/already lparen/rparen opening/closing parenthesis opening/closing round bracket left/right round bracket wax/wane parenthisey/unparenthisey left/right ear | ||||
[ ] | opening / closing bracketleft / right bracket left / right square bracket bracket / unbracket | square / unsquare u turn / u turn back | ||||
{ } | opening / closing brace open / close brace left / right brace left / right squiggly left / right squiggly bracket/brace | brace / unbrace curly / uncurly leftit / rytit left / right squirrelly embrace / bracelet | ||||
< > | less / greater than bra / ket left / right angle left / right angle bracket left / right broket | from / into (or towards) read from / write to suck / blow comes-from / gozinta in / out crunch / zap tic / tac angle / right angle | ||||
* | asteriskstar splat |
| ||||
- | dash hyphen minus | worm option dak bithorpe | ||||
. | perioddot point decimal point | radix point full stop spot | ||||
/ | slash stroke slant forward slash | diagonal solidus over slak | ||||
\ |
| bash reverse slant reversed virgule backslat | ||||
: | colon | dots two-spot | ||||
; | semicolon semi | weenie hybrid pit-thwong | ||||
= | equalsgets takes | quadrathorpe half-mesh | ||||
^ | circumflexcaret hat control uparrow | xor sign chevron shark (or shark-fin) to the fang pointer | ||||
_ | underline underscore underbar under | score backarrow skid flatworm | ||||
` | grave accent backquote left quote left single quote open quote grave |
| ||||
| | bar or or-bar v-bar pipe vertical bar | vertical line gozinta thru pipesinta spike | ||||
~ | tilde squiggle twiddle not | approx wiggle swung dash enyay sqiggle (sic) |
@font-face {
font-family: 'ChunkFiveRegular';
src: url('fonts/chunkfive.eot');}
h1, h2 {
font-family: ChunkFiveRegular, Georgia, serif;}
HTML:
<h1>Briards</h1>
<p>The brie is a large breed of dog traditionally used as a herder and guardian of sheep.</p>
<h2>Breed History</h2>
<p>The briard, which is believed to have originated in France, has been bred for centuries to herd and to protect sheep.</p>
font-size
– no more thought required. Sizing with keywords is more complicated and requires a few workarounds, but you’re in luck as the techniques are well documented. That leaves ems. At this point people often leg it. ‘Ems are too inconsistent,’ they say, ‘they’re too hard; they never work.’ Well that may be the received wisdom, but if ever the was a case of FUD then this is it. I will now attempt to show you how ems can be as quick and easy to use as pixels.BODY {font-size:62.5%}
This takes 16px down to 10px which I’m using purely because it’s a nice round number for example purposes – 10px text is too small for the real world. From now on it’s easy to think in pixels but still set sizes in terms of ems: 1em is 10px, 0.8em is 8px, 1.6em is 16px, etc. If you are laying out your document using CSS (which you are, right?) then you have probably used a few divs to group together elements. Apply text-size to these divs and your job is almost done. Consider a two column layout with header and footer:<body>
<div id="navigation"> ... </div>
<div id="main_content"> ... </div>
<div id="side_bar"> ... </div>
<div id="footer"> ... </div>
</body>
#navigation {font-size:1em}
#main_content {font-size:1.2em}
#side_bar {font-size:1em}
#footer {font-size:0.9em}
So this would give us a document where text in the navigation and side bar is displayed at 10px, the main content is 12px and the footer is 9px. There now remains a few anomalies to sort out (you’d have to do this even if you were sizing in pixels). In Mozilla-based browsers, all heading elements in our aforementioned #main_content div will be displayed at 12px whether they are an H1 or an H6, whereas other browsers show the headings at different sizes as expected. Applying text-sizes to all headings will give consistency across browsers, for example:H1 {font-size:2em} /* displayed at 24px */
H2 {font-size:1.5em} /* displayed at 18px */
H3 {font-size:1.25em} /* displayed at 15px */
H4 {font-size:1em} /* displayed at 12px */
A similar job needs to be done on forms and tables to force form controls and table cells to inherit the correct size (mainly to cater for IE/Win):INPUT, SELECT, TH, TD {font-size:1em}
And so to the final tweak and the bit folks seem to find most tricky: dealing with nested elements. We’ve already touched upon it with our headers, but for now let’s look more closely at what’s going on. First of all we changed our body text to 10px; 62.5% of its default size:16 x 0.625 = 10
Then we said our main content should be displayed at 12px. If we did nothing, the #main_content div would be displayed at 10px because it would inherit its size from the body element – its parent. This implies that we always size text relative to the parent element when using ems:child pixels / parent pixels = child ems
12 / 10 = 1.2
Next we wanted our h1 heading to be 24px. The parent to our h1 is the main_content div which we know to be 12px in size. To get our headings to be 24px we need to double that so our ems are:24 / 12 = 2
And so it goes on. Tricky stuff occurs where rules like this are applied:#main_content LI {font-size:0.8333em}
This rule implies that all main content list items should be displayed at 10px. We use the same straight forward maths to achieve this:10 / 12 = 0.8333
But what happens when one list contains another? It gets smaller. Why? Because our rule actually says that any list item in the #main_content div should 0.8333 times the size of its parent. So we need another rule to prevent this ‘inherited shrinkage’:LI LI {font-size:1em}
This says that any list item inside another list item should be the same size as its parent (the other list item). I normally use a whole set of child selectors to prevent confusion during development:LI LI, LI P, TD P, BLOCKQUOTE P {font-size:1em}
And that’s it. When sizing text in ems there’s really one rule to remember: size text relative to its parent and use this simple calculation to do so:child pixels / parent pixels = child ems
Resource from: http://clagnut.com/blog/348/