html body { margin-top: 50px !important; } #top_form { position: fixed; top:0; left:0; width: 100%; margin:0; z-index: 2100000000; -moz-user-select: none; -khtml-user-select: none; -webkit-user-select: none; -o-user-select: none; border-bottom:1px solid #151515; background:#FFC8C8; height:45px; line-height:45px; } #top_form input[name=url] { width: 550px; height: 20px; padding: 5px; font: 13px "Helvetica Neue",Helvetica,Arial,sans-serif; border: 0px none; background: none repeat scroll 0% 0% #FFF; }
Web CH 2 - Part I
Web CH 2 - Part I
Web CH 2 - Part I
• HTML contains several elements for defining text with a special meaning.
• Formatting elements were designed to display special types of text:
▪ <b> - Bold text
• <b>This text is bold</b>
▪ <strong> - Important text • <strong>This text is important!</strong>
▪ <i> - Italic text • <i>This text is italic</i>
▪ <em> - Emphasized text • <em>This text is emphasized</em>
• <p>Do not forget to buy <mark>milk</mark> today.</p>
▪ <mark> - Marked text • <small>This is some smaller text.</small>
▪ <small> - Smaller text • <p>My favorite color is <del>blue</del> red.</p>
▪ <del> - Deleted text • <p>My favorite color is <del>blue</del> <ins>red</ins>.</p>
▪ <ins> - Inserted text • <p>This is <sub>subscripted</sub> text.</p>
• <p>This is <sup>superscripted</sup> text.</p>
▪ <sub> - Subscript text
▪ <sup> - Superscript text
Compiled By Aliazar D. (MSc in SEng) 14
HTML Quotation and Citation Elements
source. </blockquote>
</body>
✓ Browsers usually indent </html>
<blockquote> elements.
• Color Values
✓In HTML, colors can also be specified using RGB
values, HEX values, HSL values, RGBA values, and
HSLA values.
• HTML RGB and RGBA Colors
▪ An RGB color value represents RED, GREEN, and
BLUE light sources.
▪ An RGBA color value is an extension of RGB with an
Alpha channel (opacity).
Compiled By Aliazar D. (MSc in SEng) 24
Conti..
• RGB Color Values o For example, rgb(255, 0, 0) is
o In HTML, a color can be specified as an displayed as red, because red is set to
RGB value, using this formula: rgb(red, its highest value (255), and the other
green, blue) two (green and blue) are set to 0.
o Each parameter (red, green, and blue) defines
the intensity of the color with a value o Another example, rgb(0, 255, 0) is
between 0 and 255. displayed as green, because green is
o This means that there are 256 x 256 x 256 = set to its highest value (255), and the
16777216 possible colors! other two (red and blue) are set to 0.
o To display black, set all color
parameters to 0, like this: rgb(0, 0, 0).
o To display white, set all color
parameters to 255, like this: rgb(255,
255, 255).
</body>
</html>
• Shades of Gray
✓ Shades of gray are often defined using equal values for all three
parameters:
<h1 style="background-color:rgb(180, 180, 180);">rgb(180, 180, 180)</h1>
<h1 style="background-color:rgb(140, 140, 140);">rgb(140, 140, 140)</h1>
<h1 style="background-color:rgb(200, 200, 200);">rgb(200, 200, 200)</h1>
Compiled By Aliazar D. (MSc in SEng) 26
Conti..
• RGBA Color Values <!DOCTYPE html>
<html>
✓ RGBA color values are an <body>
extension of RGB color values <h1 style="background-color:rgba(255, 99, 71, 0);">rgba(255, 99, 71, 0)</h1>
with an Alpha channel - which <h1 style="background-color:rgba(255, 99, 71, 0.2);">rgba(255, 99, 71, 0.2)</h1>
specifies the opacity for a <h1 style="background-color:rgba(255, 99, 71, 0.4);">rgba(255, 99, 71, 0.4)</h1>
color. <h1 style="background-color:rgba(255, 99, 71, 0.6);">rgba(255, 99, 71, 0.6)</h1>
<h1 style="background-color:rgba(255, 99, 71, 0.8);">rgba(255, 99, 71, 0.8)</h1>
✓ An RGBA color value is <h1 style="background-color:rgba(255, 99, 71, 1);">rgba(255, 99, 71, 1)</h1>
specified with: rgba(red, </body>
green, blue, alpha) </html>
✓ The alpha parameter is a
number between 0.0 (fully
transparent) and 1.0 (not
transparent at all):
31
Compiled By Aliazar D. (MSc in SEng)
<!DOCTYPE html>
<html>
<body>
Conti.. <h1 style="background-color:hsla(9, 100%, 64%,
0);">hsla(9, 100%, 64%, 0)</h1>
• HSLA Color Values <h1 style="background-color:hsla(9, 100%, 64%,
0.2);">hsla(9, 100%, 64%, 0.2)</h1>
▪ HSLA color values are an <h1 style="background-color:hsla(9, 100%, 64%,
extension of HSL color values, 0.4);">hsla(9, 100%, 64%, 0.4)</h1>
with an Alpha channel - which <h1 style="background-color:hsla(9, 100%, 64%,
0.6);">hsla(9, 100%, 64%, 0.6)</h1>
specifies the opacity for a color. <h1 style="background-color:hsla(9, 100%, 64%,
▪ An HSLA color value is 0.8);">hsla(9, 100%, 64%, 0.8)</h1>
specified with: hsla(hue, <h1 style="background-color:hsla(9, 100%, 64%,
1);">hsla(9, 100%, 64%, 1)</h1>
saturation, lightness, alpha) </body>
▪ The alpha parameter is a number </html>
between 0.0 (fully transparent)
and 1.0 (not transparent at all):
Thank you!
Any Questions?