Counter CSS2.1 - Numara elemente cu ajutorul proprietatilor de stil

Urmatorul cod CSS va numara randurile unui tabel:

table{
counter-reset:item
}

td:first-child:before{
background:#00FF00;
content: counter(item) ". ";
}

tbody tr{
counter-increment: item;
}


Rezultatul:

Name Empty Description
A
anchor
ABBR
abbreviated form (e.g., WWW, HTTP, etc.)
ACRONYM

ADDRESS
information on author
AREA E client-side image map area
B
bold text style
BASE E document base URI
BDO
I18N BiDi over-ride
BIG
large text style
BLOCKQUOTE
long quotation
BODY
document body
BR E forced line break
BUTTON
push button
CAPTION
table caption
CITE
citation
CODE
computer code fragment
COL E table column
COLGROUP
table column group
DD
definition description
DEL
deleted text
DFN
instance definition
DIV
generic language/style container
DL
definition list
DT
definition term
EM
emphasis
FIELDSET
form control group
FORM
interactive form
H1
heading
H2
heading
H3
heading
H4
heading
H5
heading
H6
heading
HEAD
document head
HR E horizontal rule
HTML
document root element
I
italic text style
IMG E Embedded image
INPUT E form control
INS
inserted text
KBD
text to be entered by the user
LABEL
form field label text
LEGEND
fieldset legend
LI
list item
LINK E a media-independent link
MAP
client-side image map
META E generic metainformation
NOSCRIPT
alternate content container for non script-based rendering
OBJECT
generic embedded object
OL
ordered list
OPTGROUP
option group
OPTION
selectable choice
P
paragraph
PARAM E named property value
PRE
preformatted text
Q
short inline quotation
SAMP
sample program output, scripts, etc.
SCRIPT
script statements
SELECT
option selector
SMALL
small text style
SPAN
generic language/style container
STRONG
strong emphasis
STYLE
style info
SUB
subscript
SUP
superscript
TABLE

TBODY
table body
TD
table data cell
TEXTAREA
multi-line text field
TFOOT
table footer
TH
table header cell
THEAD
table header
TITLE
document title
TR
table row
TT
teletype or monospaced text style
UL
unordered list
VAR
instance of a variable or program argument


Scopul:
Tabelul de mai sus reprezinta lista completa a tagurilor HTML. Au fost excluse elementele depreciate sau cu dtd loose. Necunoscuta este 77 [taguri HTML].

Niciun comentariu:

Trimiteți un comentariu