Вы находитесь на странице: 1из 3

Cheatsheet 

 
​ efine a comment​ ​--> 
<!--​ D <a href=”​https://codette.ro​”> </a>​ ​Defines a 
<!DOCTYPE html>​ ​Defines the document type  hyperlink 
​ efines a html document  
<html> </html>​ D ● A​ll HTML elements can have attributes, they provide 
additional information about an element and are always 
<head> </head>​ ​Defines information about  specified in the start tag. Attributes usually come in pairs like: 
name="​value​"​. 
● Attributes for hyperlink: ​href=”https://yourlink.com”, 
the document  target=”_blank” (open in new tab) 
 
<title> </title>​ ​Defines the document title  
 
<link rel="​stylesheet​" type="​text/css​" 
 
href="​mystyle.css​"> ​Defines an external style 
 
sheet 
 
<body> </body>​ ​Defines the body element 
​ efines an 
<img src=”​yourPath/codette.jpg​”>​ D
​ efines a paragraph  
<p> </p>​ D
image  
  ● It’s a ​single tag ​(does not have a closing tag). 
● Attributes for image tag: ​src=”yourPath/Link”, alt, width, 
  height, title, border. 
 
<h1></h1>​ ​to​ <h6></h6>​ ​Defines heading 1 to  <span> </span>​ ​Defines a group 
heading 6   inline-elements in a document 
 
   
<ol value=”​A​”> </ol>​ ​Defines an  <div class=”​general​” id=”​unique​”> </div> 
o​rdered ​l​ist  Defines a section in document 
● Attribute for ordered list tag: ​value=”a”   ● The <div> element is often used as a container for other HTML 
● The value can be: A, a, 1, i, I   elements. 
   
​ efines an 
<ul type=”​disc​”> </ul>​ D ● H​TML elements can have as attribute a c​ lass​, that​ ​is used to 
define equal styles for elements with the same class name or 
u​nordered ​l​ist  an ​id​, that specifies a unique id for an HTML element (the 
value must be unique within the HTML document) 
● Attribute for ordered list tag: ​type=”none”   
● The type can be: disk, circle, square, none 
 
 
<li> </li>​ ​Defines a list item 
 
<form> </form> ​ ​Defines a form 
<input type=”​text​”> ​ ​Defines an input field 
●  
It’s a ​single tag ​(does not have a closing tag).  
● The type can be: text, submit, radio, checkbox, date, email, 
number, password  div { 
 
<button type="​button​"> </button> ​ ​Defines a  color: #fff | white; ​//color of text 
font-family: Arial; ​//font of text 
push button  
background-color: #000;  
● The type can be: button, reset, submit  
  } 
 
 
   
.​general​ { ​//in CSS we use “​.​” to indicate a ​class  <div id=”​hero​” class=”​small​”> </div> 
width: 512px; ​//sets the width of an element   
height: 128px; ​//sets the height of an element 
//find an element by element id 
padding: 16px;   
document​.getElementById(​hero​)  
border: 8px;  
margin: 16px;     
  //remove a class from a <div> element 
  document​.getElementById(​hero​) 
 
.classList​.remove(“​small”​)​;  
 
=>​ <div id=”​hero​”> </div> 
#​unique​ { ​//in CSS we use “​#​” to indicate an ​id 
 
//defines the radius of the element's corners  
//add a class from a <div> element 
border-radius: 50%;   
document​.getElementById(​hero​) 
//specifies how an element should float 
.classList​.​add("​big​")​;  
float: left | right;  
//specifies the horizontal alignment of text in  =>​ <div id=”​hero​” class=”​big​”> </div> 
 
an element   
 
text-align: center | left | right | justify;  

Вам также может понравиться