toiled over this,
but here it is. when styling a sub-element (selector: decloration) the
order is parent or main selector
'a' (anchor, link) the 'sub-class'
'.normal' (you create)
then the 'alternate' selector (action) ':hover'
this defines what will happen to selector (class) a.normal (what it will look like) when cursor is ':hoovered' over it.
likewise with the selector:declaration 'TD' with slit difference of a space instead of a ':' (colon) - table.main td
A few of these I use a lot are ':hover', ':after' and ':nth-child'
the 'hover' class is used to change something, like the color of text when a mouse cursor is 'hovered' over the element. I use it on most of my 'a' (anchor) or link elements
a:hover { font-family: inherit; text-decoration: underline; background-color:inherit; color:rgb(96,0,0); font-weight:inherit; }
Another ':pseudo' class i use regularly is in my 'signature'
Landis
the way this works is i use <p class"sig"> and 'sigright' which are defined in my stylesheet as:
.sig { font-family:helvetica, arial, tahoma; font-size:1.1em; color:rgb(0,0,0); text-decoration:none; padding:2px; } .sig:after { content:" ☡"; font-size:inherit; } .sigright font-family:helvetica, arial, tahoma; font-size:1.1em; color:rgb(0,0,0); text-decoration:none; padding:2px; text-align:right; margin-left:90%; margin-right:6px; } .sigright:after { content:" ☡"; font-size:inherit; }
What hapens is the ':after' inserts the unicode character " ☡" including leading space after what I've typed inside the <p class="sig">, in this case my name <p class="sigright">Landis</p>
I use the 'sigright' to 'sign' on the right side of a 'document' just as you would a legal doc in real life.
Landis
And the ':nth-child' i use to alternate row colors in a table.. see: my table of Named HTML characters on the SpecialCharacters page
3 types of <style="inline, in head or attached external stylesheet">
also see document at W3C.org titled 'valid-dtd-list'
Here are a few examples:
<p style="color: #090; line-height: 1.2">...</p>
<p style="{color: #090; line-height: 1.2} ::first-letter {color: #900}">...</p>
<a href="http://www.w3.org/" style="{color: #900} :link {background: #ff0} :visited {background: #fff} :hover {outline: thin red solid} :active {background: #00f}">...</a>
<div class="navigation"> style="@import url(navigationstyles.css);">...</div>
<style type="text/css">
body {
background-color:rgba(240,240,240,1.0);
}
p {
color:rgb(80,80,80);
font-size:12px;
indent:4px;
}
</style>
</head>
<body>
<head> <link rel="stylesheet" type="text/css" href="stylecss.css" / >
Note: in CSS1 and CSS2, the spelling of '::first-letter' and '::first-line' is ':first-letter' and ':first-line' respectively, i.e., with a single colon, but Selectors recommends using double colons for pseudo-elements.
aligning text 'center' using style: in my footer, there is an image (html-kit, logo) on the right side, same line as my 'copyright' statement.
if i use the styling 'p class='' with 'style="text-align:center; "> the text is centered in the space between the image and the left margin, so i doesn't appear centered especially with a small 'thank you' 'centered' below it to compare it to.
so I tried this ".. style="text-align:center; margin-left:+80px; which i was hoping would center and then 'add' 80 pixels to the left.
I think it would be like messing around ' margin-left:XXpx; margin-right:XXpx; ">..
don't know yet if it's CSS compliant, but it works!
including in the head of a single document:
I have several examples bellow, so look there
*note: /* css comment */ = a css comment, not processed by server or browser
somewhere after <head>
<style type="text/css">
/* 'comment' this is the definition of element <td> for the parent element table class 'main'*/
/* 'comment' border:1px solid black; -this is 'shorthand that does the same as the following*/
table.main td {
border-width:1px;
border-style:solid;
border-color:rgba(80,80,80,0.5);
border-spacing:0px;
color:black;
font-family: Helvetica, Arial, sans-serif;
font-size:100%;
font-style:none;
}
</style>
,but before </head>
and <body>
Landis.
the following is an 'inline' style declaration. in this example, i'm modifying the <p> (paragraph) tag (selector, element)
<p style="color:gray; font-size:12px; text-transform:oblique; >
here is a basic style for the rotated 'box'. 270deg is equal to -90deg (counter clockwise). I hate the moz,webkit,ms crap, but i can't find a definitive resolution at w3c for css2.1/3 that works : (
Font-Family:Helvetica, Arial, Tahoma, etc.. - You NEED the comma's between font family names!
Like I've said, there are No standards, even within the 'standards'.. sometimes they feel like comma's sometimes they don't... : (
Headline (<H>) 1 thru 6.. that's it. Sooometimes,,, you can use 7, but I've never been able to use <h8>
{ most complete w3c Font Reference i've found: }