HTML & CSS Elements List

HTML Elements

Meta Information

title
Defines the title of a page. It must be placed within the head element.
				
	<!DOCTYPE html>
	<html>
	<head>
		<title></title>
	</head>
	<body>

	</body>
	</html>
				
link
Defines a link to and external resource. It is most commonly used to link a CSS file to an HTML document. It should be place within the head element
				
	<link rel="stylesheet" type="text/css" href="css/style.css">				
				

Structure

div
Division. Defines a block of HTML. (Block Element)
				
	<div></div>		
				
				
span
Used to group in-line HTML. span applies no meaning and is commonly used solely to apply CSS. (Inline Element)
				
	<span></span>			
				
				

Lists

ul
Unordered list. Defines a list that has no logical sequence. Used with li.
				
	<ul>
		<li>Milk</li>
		<li>Eggs</li>
		<li>Bread</li>
	</ul>
				
				
  • Milk
  • Eggs
  • Bread
ol
Ordered list. Used to define a list that has a logical sequence. Used with li.
				
	<ol>
		<li>Milk</li>
		<li>Eggs</li>
		<li>Bread</li>
	</ol>
				
				
  1. Milk
  2. Eggs
  3. Bread
li
List item. Used with ul or ol
				
	<li></li>
				
				

CSS Elements

Font & Text

font-style
italic, normal ,initial
				
	font-style; italic;			
				
				
font-weight
normal, lighter, bold, bolder, interger (100-900; 400 normal 700 bold)
				
	font-weight: 900;
				
				
font-size
We will use pixels (px) as our measurement unit. (% and em is also possible)
				
	font-size: 24px;
				
				
color
Text color. We will use hexadecimal.
				
	color: #339933;
					
				
letter-spacing
We can increase or decrease space between letters.
				
	letter-spacing: 10px;
				
				
line-height;
We can increase or decrease the line spacing.
				
	line-height: 24px;
				
				
text-align
Text alignment. We will use: left, right, center and justify.
				
	text-align: center;
				
				
text-decoration
none, blink, line-through, overline, underline
				
	text-decoration: underline;			
				
				
text-transform
capitalize, lowercase, uppercase
				
	text-transform: uppercase;			
				
				
vertical-align
We will use bottom and top (and center).
				
	vertical-align: top;
				
				
opacity
The opacity property can take a value from 0.0 - 1.0. The lower value, the more transparent.
				
	opacity: 0.4;			
				
				

Selector

hover
The :hover selector is used to select elements when you mouse over them.
				
	.mytitle:hover {
		opacity: 0.4;
	}
				
				

Box model

CSS Box Model
height
We will use pixels (px) and percent (%) as our measurements units.
				
	height: 200px;
				
				
width
We will use pixels (px) and percent (%) as our measurements units.
				
	width: 600px;					
				
				
margin
Margin defines the space around elements (outside the border). The margin property can have from one to four values:

→ margin: top, right, bottom, left;
→ margin: top, right & left, bottom;
→ margin: top & right, bottom & left;
→ margin: all four margins;

				
	margin: 20px 10px 35px 25px;
	margin: 20px 35px 25px;
	margin: 20px 10px;
	margin: 20px;	
				
				
padding
padding defines the space inside the border. The padding property can have from one to four values:

→ padding: top, right, bottom, left;
→ padding: top, right & left, bottom;
→ padding: top & right, bottom & left;
→ padding: all four paddings;

				
	padding: 20px 10px 35px 25px;
	padding: 20px 35px 25px;
	padding: 20px 10px;
	padding: 20px;	
				
				

Cool Stuff (May have problem with Non-webkit Browsers)

Rainbow !!!
Make rainbow text!!!!!!!!!! (ONLY WORKS ON WEBKIT BROWSERS)
				
	.rainbow {
 		 background-image: -webkit-gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
  		background-image: gradient( linear, left top, right top, color-stop(0, #f22), color-stop(0.15, #f2f), color-stop(0.3, #22f), color-stop(0.45, #2ff), color-stop(0.6, #2f2),color-stop(0.75, #2f2), color-stop(0.9, #ff2), color-stop(1, #f22) );
  		color:transparent;
  		-webkit-background-clip: text;
 		 background-clip: text;
	}
			
Pop up text
Make a cool pop up text
			
	.pop-up{
		-webkit-transition: all 0.12s ease-out;
	}	
	.pop-up:hover {
		position: relative; top: -3px; left: -3px; 
		text-shadow: 1px 1px #fe4902, 2px 2px #fe4902, 3px 3px #fe4902, 4px 4px #fe4902, 5px 5px #fe4902, 6px 6px #fe4902;
		-webkit-transition: all 0.12s ease-out;
	}
			
			
Animations
Like this !
			
	.anime{
		-webkit-transition: all 3s linear;
	}
	.anime:hover{
		-webkit-transform: translate(700px,0);
	}
	*also can do with rotate(degree) ;transform(x,y) all properties such as color,width,height,size,scale();
				
			
			
Further Animation
setting key frames
			
	.anime2{
		width: auto;
		-webkit-transition-property: font-size,color,-webkit-transform;
		-webkit-transition-duration: 1s,1s,1s;
		-webkit-transition-timing-function: ease,ease-out,ease;
		-webkit-transition-delay: 0s,1s,1s;
	}
	.anime2:hover{
		font-size: 50px;
		color: purple;
		-webkit-transform: rotate(360deg);
	}	
	*Increase in size => turns purple => rotate
			
			
Spinning Box
			
	@keyframes color-change{
		0% {
			background-color: red;
			left: 0px;
			-webkit-transform: rotate(0deg) scale(1);
		}
		50% {
			background-color: blue;
			left: 80%;
			-webkit-transform: rotate(180deg) scale(2);
		}
		100%{
			background-color:red;
			left: 0px;
			-webkit-transform: rotate(360deg) scale(1);
		}
	}
	.spinning-box {
		display:block;
		height: 100px;
		width: 100px;
		top: 10px ;left : 10px;
		position:relative;
		animation-name: color-change;
		animation-duration: 2s;
		animation-iteration-count: infinite;
	}
			
			
Come Here!