HTML COMMENTS

  • HTML comments are text, phrases or sentences inside an HTML file.
  • They are only shown in codes and not rendered by a browser.

WHY USE HTML COMMENTS?

  • HTML comments help both beginners and experienced web developers to easily organize their codes.
  • They act like sticky notes in HTML files.

HOW TO WRITE HTML COMMENTS?

 An HTML comment starts with <!--and ends with -->
it looks like this:
   <!--comments go here -->

HT ML STYLES 

  • HTML Styles are used to style HTML elements it also means changing default values.
  • For instance ,styling can change the default values of text color as black, background color as white ,text alignment as left and text size as 12 pixels.

INTERNAL STYLE SHEET (internal styling)

  • Using an internal style sheet is also called internal styling.
  • An internal style sheet is composed of an or more cascading style sheet (CSS) rule-set.
  • A CSS rule-set consists of a selector and a declaration block surrounded by curly braces that contains one or more CSS declaration separated by semicolons.
  • Each declaration includes a CSS property name and a value, separated by a colon.
  • They are all enclosed inside the <style> element with its type = "text /css" attribute which is included inside the <head> element.

INTERNAL STYLE SHEET SYNTAX

<style type = "text/css">
       p{
            font-size: 14px;
        }
</style>

INLINE STYLING

Inline styling is used to styling elements using the style attribute with css declaration inside which are similar to internal styling.

INLINE STYLING SHEET

<div style="property : value; property:value;">

BACKGROUND COLOR EXAMPLE:

<!DOCTYPE html>
<html>
<head>
    <title> color</title>
</head>
<body style= "background-color:gold">
</body>
</html>
TRY THIS PROGRAM IN NOTE PAD OR IN ONLINE HTML COMPLIER

EXAMPLE:



TEXT COLOR EXAMPLE

<!DOCTYPE html>
<html>
<head>
    <title> color</title>
</head>
<body style= "background-color:gold">
<p style="color:red"> This text in red color.</P>
</body>
</html>

OUTPUT :

This text in red color

TEXT FONT-FAMILY EXAMPLE

<!DOCTYPE html>
<html>
<head>
    <title> color</title>
</head>
<body style= "background-color:gold">
<h1 style="font-family: Times New Romen"> I am a Times New Romen </h1>
<p style="color:red"> This text in red color.</P>

</body>
</html>

TEXT ALIGNING EXAMPLE

<!DOCTYPE html>
<html>
<head>
    <title> color</title>
</head>
<body style= "background-color:gold">
<p style="text-align: left"> This text in red color.</P>
<p style="text-align: center"> This text in red color.</P>
<p style="text-align: right"> This text in red color.</P>
</body>
</html>

TEXT SIZING EXAMPLE

<!DOCTYPE html>
<html>
<head>
    <title> color</title>
</head>
<body style= "background-color:gold">
<p style="font-size: 50px"> This text in red color.</P>
</body>
</html>











Post a Comment

Previous Post Next Post