W3 Notes
W3 Notes
Hyper Text Markup Language ((.html)); the standard markup language for creating
Webpages
describes the structure of the page; series of elements; elements tell the browser
how to
display the content; HTML elements label pieces of content such as "this is a
heading, etc.
>>>>>HTML History<<<<<
1989 Tim Berners-Lee invented www
1991 Tim Berners-Lee invented HTML
1993 Dave Raggett drafted HTML+
1995 HTML Working Group defined HTML 2.0
1997 W3C Recommendation: HTML 3.2
1999 W3C Recommendation: HTML 4.01
2000 W3C Recommendation: XHTML 1.0
2008 WHATWG HTML5 First Public Draft
2012 WHATWG HTML5 Living Standard
2014 W3C Recommendation: HTML5 ************
2016 W3C Candidate Recommendation: HTML 5.1
2017 W3C Recommendation: HTML5.1 2nd Edition
2017 W3C Recommendation: HTML5.2
EDITORS///
~Learn Html~
Recipe:
- A simple text editor
BASIC///
ELEMENTS///
<br> line break
just use lowercase
ATTRIBUTES///
>>>>>The src Attribute<<<<<
1. Absolute URL = Link to another website
2. Relative URL = Link to image hosted within website. (something about domain)
HEADINGS///
Browsers automatically add a margin before and after heading
search engines use headings to index the structure and content of webpage
h1-h6 most-least important; only for headings not BIG and BOLD
<h1 style="font-size:###px;">...</h1>
PARAGRAPHS///
<hr> Horizontal Rule thematic break; seperate content (or define a change)
<pre>
Can type the
text how
you want
it
</pre> ((pre-formatted))
<tagname style="property((CSS)):value((CSS));">
TEXT FORMATTING///
<b> bold
<strong> important
<i> italic
<em> emphasized
<mark> marked
<small> smaller
<del> deleted
<ins> inserted
<sub> subscript
<sup> superscript
COLORS///
<h1 style="border:2px solid (color);">Sup Nigga</h1>
>>>>>Color Values<<<<<
rgb >>> rgb(255,255,255)/ rgba (,.5)
hex >>> #af6789
hsl >>> (9, 100%, 64%)/ hsla (,.5)
...a for alpha channel (opacity)0.0-1.0
rgb(1:1:1)=gray Low#=Dark
>>>>>USING CSS<<<<<
--Inline = style attribute inside HTML elements
>apply a unique style to a single HTML element
>>>>>CSS BORDER<<<<<
p {
border: 2px solid powderblue;
}
LINKS///
>>>>>Hyperlinks<<<<<
Links allow users to click their way from page to page; HTML links are hyperlinks.
Link >>> Another Document
Link = any HTML element
>>>>>Syntax<<<<<
<a> defines a hyperlink
syntax >>> <a href="url">link text</a>
>>>>>Link Email<<<<<
<a href="mailto:(email)">text</a>
>>>>>Button Link<<<<<
>>>>>Link Titles<<<<<
<a href="url" title="yada yada"> hara hara</a>
hara hara shows as link; hover over = "yada yada"
>>>>>Link Colors<<<<<
<style>
<style>
a:link {
color: green;
background-color: transparent;
text-decoration: none;
}
a:visited {
color: pink;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: red;
background-color: transparent;
text-decoration: underline;
}
a:active {
color: yellow;
background-color: transparent;
text-decoration: underline;
}
</style>
<style>
a:link, a:visited {
background-color: #f44336;
color: white;
padding: 15px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
}
a:hover, a:active {
background-color: red;
}
</style>
-------------------------------------------------
Create Bookmarks
<element id="C4">Chapter 4</h2>
<a href="#C4">Jump To CHaper 4</a>
IMAGES///
<img src=".jpg" alt="yea">
>>>>>Width/Height<<<<<
<img src=... alt=... style="width:;height:;">
<img src=... alt=... width="" height="">
<map name="workmap">
<area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
<area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
<area shape="circle" coords="337,300,44" alt="Coffee" href="coffee.htm">
</map>
>>>>>Shape<<<<<
rect eh ok
circle eh
poly what the fuck
default
<style>
element {
background-image: url('name.file');
background-repeat: no-repeat; ((One image))
background-size: cover; ((cover entire element))
background-attachment: fixed ((cover entirely and keep proportions))
background-size: 100% 100%; ((stretch and always cover entire element))
}
</style>
>>>>>HTML Tables<<<<<
<table> table
<tr> row
<th> header
<td> cell
<caption> table caption
...???
mada<colgroup>
mada<col>
mada<thead>
mada<tbody>
mada<tfoot>
>>>>Table Border<<<<<
table, th, td {
border: 1px solid black;
}
>>>>>Invisible Border+Style<<<<<
th, td {
border-color: #nigga4
} ((invisible border plus style))
>>>>>Table Caption<<<<<
<table style="width...">
<caption>Dead Nigas Of 2017</caption>
<tr>...
---------------------------
tr:nth-child(even) {
background-color: #nigg3r
}
td:nth-child(even), th:nth-child(even) {
background-color: #nigg3r;
}
>>>>>Horizontal Dividers<<<<<
tr {
border-bottom: 1px solid #dog
}
>>>>>Hoverable Table<<<<<
tr:hover {background-color: #NigG3r;}
<dl>
<dt>=term name</dt>
<dd>- defines each term</dd>
</dl>
<ul>
<li>yea</li>
<li>yeah
<ul>
<li>yuh</li>
<li>yah</li>
</ul>
</li>
<li>yay</li>
</ul>
yaaah
----------------------------
Inline Elements
-a -abbr -acronym -b -bdo -big -br -button -cite -code
-dfn -em -i -img -input -kbd -label -map -object -output
-q -samp -script -select -small -span -strong -sub -sup -textarea
-time -tt -var
... {
float: ((positioning and formatting content//
Allow elements to float next to each other instead of on top))
<style>
.mycontainer {
width:100%;
overflow:auto;
}
.mycontainer div {
width:33%;
float:left;
}
</style>
INLINE BLOCK///
div {
width:30%
display: inline-block; ((change <div> display property from block to inline-block
} = no longer add a line break before and after and will
display side by side))
div {
margin:auto;
} ((center the div))
FLEXBOX///
<style>
.mycontainer {
display: flex;
}
.mycontainer > div {
width:33%;
}
</style>
GRID CONTAINER///
<style>
.grid-container {
display: grid;
grid-template-columns: 33% 33% 33%;
}
</style>
HTML id Attribute///
must be unique to an element; unlike class=""
id="this"
<a href="#this">...</a>
or...
<a href="name.html#this">...</a>
HTML iFrames///
<iframe> ((specifies an inline frame))
;used to embed another document within the current html
change styles
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "red";
document.getElementById("demo").style.backgroundColor = "yellow";
document.getElementById("image").src = "picture.gif";
>>>>>BEST PRACTICE<<<<<
Use relative paths so it's not bound to your current base URL.
localhost = works on your own computer, current public domain and future public
domains.
Setting the viewport to make your website look good on all devices:
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Define the character set used:
<meta charset="UTF-8">
<link>
<script> ((JS))
<base> specifies the base URL/target for all relative URLs in a page.
(href=)/target
one per document
</head>
Techniques<<<<<
CSS framework ((fast; W3.CSS / Bootstrap)
CSS flexbox
ensures that elements behave predictably when the page layout must
accomodate different screen sizes and different display devices
CSS grid
grid-based layout system; rows and columns.
easier to design web pages without having to use floats and positioning.
a responsive web design automatically adust for different screen sizes and view
ports.
RWD = .html and .css to auto resize, hide, shrink, or enlarge a website to make it
look good on all devices
>>>>>Responsive Images<<<<<
Images that scale nicely to fit any browser size.
Max-width property: if set: 100%; scale down if have to but never more than
original
>>>>>Media Queries<<<<<
define completely different styles for different
browser sizes.
<!--A responsive web page should look good on large desktop screens and on small
mobile phones-->
<details> defines additional details that the user can view or hide.
<time> date/time