Friday 10 July 2015

HTML and CSS Reference

Some Basic HTML Tags


TagExplanationAttributeOptions
<H1>, <H2>, <H3> ... <H6>Heading Tags

<P>Start a new paragraph  
<BR>Single line break  
<B>Bold text  
<I>Italics  
<OL>Ordered ListTYPEA (Capitals)
a (Lowercase)
I (Capital Roman Numerals)
i (Lowercase Roman Numerals)
1 (Numbers)
<UL>Unordered ListTYPECircle, Disc, Square
<LI>An item for your list  

CSS Font and Text Properties


CSS PropertyExample ValueOther Values
text-align:centerLeft, Right
font-family:Verdana, Arial, Helvetica, Sans-Serif 
font-size:16px|percent |em |xx-large, x-small, small, medium, large, x-large, smaller, larger
font-style:italicnormal (the default), oblique
font-variant:small-caps 
font-weight:BoldBolder | Lighter | Any number from 100 to 900
Color:RedA colour name, Hexadecimal value, RGB Value

CSS borders, backgrounds, margins, padding


CSS PropertyCSS Value
border-styledotted, dashed, solid, double, groove, ridge, inset
border-widthA pixel value like 2px
border-colorA colour value
background-colorA colour value
background-imageurl('my_image_name.gif');
background-repeatrepeat, repeat-x, repeat-y, no-repeat
background-positiontop left, top center, top right, center left, center center, center right, bottom left, bottom center, bottom right
clearleft, right , both , none
floatright, left , none
marginA pixel value like 5px
margin-leftA pixel value like 5px
margin-rightA pixel value like 5px
margin-topA pixel value like 5px
margin-bottomA pixel value like 5px
paddingA pixel value like 5px

CSS used in the Positioning section


CSS PropertyCSS ValueExplanation
/* */A colourCSS comment - more than one line
//A colourCSS comment - one line
position:relative, absolute, fixedTypes of positioning
topA pixel valuePosition an element on the page
bottomA pixel valuePosition an element on the page
leftA pixel valuePosition an element on the page
rightA pixel valuePosition an element on the page
z-indexA numerical valueUsed to stack elements one behind the other
floatleft, rightFloat an element left or right
clearleft, right, bothClear a floated element

Images and DIVs

HTML TagAttributes
IMGSRC, ALT, HEIGHT, WIDTH, USEMAP
DIV 
FIGURE 
FIGCAPTION 

Hyperlinks

HTMLExplanationAttributesOptions
A HREFThe HTML for a hyperlinkTARGET_blank _parent _self _top
  Mailto:An email address
A IDJump to a section of your page, a bookmark  

HTML5 Layout Tags


HTML5 TagComments
HEADERUsed for the heading of any section
NAVUsed for a navigation area
SECTIONUsed for a section of your web page
ARTICLEUsed for an article in a section of your web page
FOOTERUsed for the footer area

HTML and HTML5 Tables

HTML and HTML5 Table tagsExplanation
TABLECreate a table
TRCreate a row in a table
TDCreate a cell in a table
THEADHTML5 Table header
TFOOTHTML5 Table footer
TBODYHTML5 Table body

HTML Table Attributes

   TABLE Attributes   Options
AlignLeft, Right, Center
ValignTop, Middle, Bottom
BackgroundThe location of an image
BorderA number for the border width
BgcolorA background colour for the table
CellpaddingA number that sets the space inside a table cell
CellspacingA number that sets the space between table cells
HeightThe height of a table or cell
ColspanThe number of columns you want to span
RowspanThe number of rows you want to span
WidthThe width of a table or cell

HTML Form Tags

   Main Form Tags   Comments
FormCreate a HTML form
NameAdd a name for your form
MethodSelect a method, GET or POST
ActionSay where the form should be sent
InputCreate a HTML form element
TypeSelect a type of form element
LabelAdd a label for a form element
ValueA value for your form elements

HTML Form Elements

   Input Types   Comments
ButtonCreate a clickable button
CheckboxCreate a checkbox
HiddenCreate a hidden form element
ImageSpecify an image to be used as a button
PasswordSet up a password box
RadioCreate a radio/option button
ResetCreate a reset button
SubmitCreate a submit button for your forms
TextCreate a text box

HTML5 Form Elements and Attributes

HTML5 Form ElementsComments and Options
PlaceholderPlaceholder text
RequiredRequire an element to be filled in
EmailEmail text box
URLURL text box
NumberNumber spinners
RangeSliders with a range of numbers
Date/TimeDate and time textbox or calendar
SearchA search box
ColorColour picker
DatalistUsed with datalists are LIST, OPTION, VALUE, LABEL

HTML5 Video Tags

HTML5 Video TagsComments
VIDEOThe main tag to add a video
SOURCEAdd a source attribute
SRCSpecify where the video is
TYPEAdd codex values

HTML5 Audio Tags

HTML 5 Audio TagsComments
AUDIOThe main tag to add audio
SOURCEAdd a source attribute
SRCSpecify where the video is
TYPEThe main tag to add audio

HTML5 Options for the Audio Tag

Audio AttributesValues
AUTOPLAYtrue or false
LOOPtrue or false
CONTROLStrue or false
PRELOADnone, auto, metadata

HTML Special Characters


CharacterHTML EntityISO Latin-1Comments
"&quot;&#34;Double quotation mark
' &#39;Single quote or apostrophe
&&amp;&#38;Ampersand
÷&divide;&#247;Divide symbol
>&gt;&#62;greater than
<&lt;&#60;less than
Space&nbsp;&#160;Create a non-breaking space. Equates to a single tap on the keyboard spacebar
£&pound;&#163;British Pound Sterling
&euro;&#8364;Euro

0 comments:

Post a Comment