Professional Documents
Culture Documents
So, for example, if you want to make some text bold or italic, you might do
something like this:
I want to make <b>these words bold</b> and <i>these other words italic</i>.
I want to make these words bold and these other words italic.
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
3. A few tags do not occur in matching pairs, because they are used to
insert something, rather than describe text. These are called “empty”
or “void” tags, and the most common one is the one used for
inserting an image. The src attribute is used to specify the URL of
the image.
Ex. <img src="https://media.whoishostingthis.com/2/v60/images/wiht-
logo.png" />
This is a div.
</div>
2. Inline elements
Inline elements are elements used within text. Bold ( <strong> ), italic
( <em> ), and links ( <a> ) are all inline elements.
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
Inline elements are sometimes called “span-level” elements. There is also
a generic span-level element, simply called a span ( <span> ).
<span class="special-text">This text is special.</span>
Class attributes
<li class="current-item">
<a href="/about">About</a>
</li>
<li class="menu-item">
<a href="/contact">Contact</a>
</li>
</ul>
.first {
color: green;
}
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
The above CSS code means that within any element that has a class of first, the
text color should display as green.
ID attribute
Comment Tags
Comments begin with an angle bracket, followed by an exclamation point
and two dashes. They end with two dashes and a closing angle-bracket.
<!-- This is a comment. -->
Comments may be multi-line.
For nested Comments:
<!--
If I try to nest a comment inside another comment.
<!-- Like this -->
Then this the part after the first closing tag will fall outside the
comment.
-->
Paragraphs
The paragraph tag — <p> — should surround every paragraph of text in
your main content.
<article>
<p>Using the paragraph tag properly ensures that your line spacing between
paragraphs will display properly. It also helps with assistive
technologies like text-to-voice readers (it helps with proper
pausing).</p>
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
</article>
Headlines
HTML provides six levels of headline elements, <h1> through <h6>.
<h1>The most important title on a page</h1>
<h3>Sub-section heading.</h3>
<blockquote>
To be or not to be, that is the question.
</blockquote>
To be or not to be, that is the question.
If you want to cite the source of the quote, there are two ways to do that.
The <blockquote> element can be given a cite attribute, or a byline can be
added with a <cite> tag surrounding the source title. You can also do both.
<blockquote cite="http://www.gutenberg.org/ebooks/2265">
To be or not to be, that is the question.<br>
— <cite>Hamlet</cite>, William Shakespeare
</blockquote>
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
Inline Quote
Hyperlinks
One of the most important tags in HTML is the anchor tag ( <a> ), which
defines a hyperlink.
<a href="http://example.com">This is a link to example.com</a>
Text decoration
There are a number of simple tags which are used for basic text markup
within a paragraph or other element.
Bold
There are two tags that can be used for making text bold.
<strong> is recommended for use to mark “important” text. It causes
the wrapped text to display as bold but also carries semantic meaning (that
the text itself is somehow important).
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
<b> simply bolds the text without suggesting any particular semantic
meaning.
Italic
Underline
<u> is
the generic tag for underlining text. The use-case presented by
the specifications is underlining misspelled words. The HTML5 spec also
wants you to know that other elements are usually more appropriate, and
dont use this if it could be mistaken for a link.
<ins> means text that has been inserted, and is usually used in
conjuction with the <del> tag, to show the changes made to a text.
<p>The show will begin at <del>7:00pm</del> <ins>8:00pm</ins>.</p>
Line-Through
There are two elements which mark text to be lined through. Each has a
slightly different meaning.
<del> is for text which is to be understood as deleted or changed, and
it used with the <ins> tag as noted above.
<s> is used for text which is no longer correct or no longer relevant.
There is also a <strike> tag which was available in HTML4.
Text sizing
You can make text arbitrarily larger or smaller with two elements that
otherwise have no specific meaning:
<big>
<small>
<Span>
The generic <span> element
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
generic <span> element, along with a class attribute (and some CSS) to
create the desired effect.
<p>I'm not sure why there isn't a sarcasm tag. Maybe it just isn't needed
because <span class="sarcasm">tone is so easy to read on the
internet.</span></p>
Separators
HTML provides two tags for adding in separation within text.
Structural HTML
This section explains the overall structure of an HTML document, including
what types of information are contained in the <head> and <body>. It also
explains how to organize the various sections of a typical web page. There
will be more information in the HTML5 section below.
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
Nested inside the <html> tag are two sections, the <head> and the <body>.
The body contains all the visible content, while the head contains
information about the document itself. Nothing is outside of these two
sections.
<!DOCTYPE html>
<html lang="en">
<head>
.
<!-- Info about document here. -->
.
</head>
<body>
.
.
<!-- Contents of document here. -->
.
.
</body>
</html>
This is the basic structure of every HTML document. Everything is basically
extra.
Metadata
Character Encoding
There are several different common ways to encode characters (letters,
numbers, and punctuation) in computer memory. If you dont specify which
one you are using, the web browser may mess up and display some of the
wrong characters.
Most of the the time, these days, you want to specify the UTF-8 character
set.
<meta charset="utf-8">
…….
……….
………….
………….
………….
…………..
Source: https://www.whoishostingthis.com/resources/html-for-beginners/
Basic information about the document — who wrote it and what it is about
— are also conveyed through <meta> tags. These each have two attributes:
the name of the tag, and the content of the tag.
<meta name="description" content="A page about HTML.">
<meta name="keywords" content="HTML, tags, metadata">
<meta name="author" content="Adam Michael Wood">
CSS Links
Style Sheets, written in the CSS (Cascading Style Sheet) language, are
separate documents which provide information about how to display a
page in a browser. Information about sizes, colors, placement, and fonts
are all contained in the style sheet.
CSS style sheets are linked to within the <head> of the HTML document,
using the <link> tag. The href attribute specifies the URL of the style
sheet file, and the rel attribute specifies that the link is a stylesheet link.
<link href="/css/style.css" rel="stylesheet">
Source: https://www.whoishostingthis.com/resources/html-for-beginners/