Web Tech Prog

Embed Size (px)

Citation preview

  • 8/13/2019 Web Tech Prog

    1/27

    1. Write HTML code to Li tag .

    An ordered list:

    Coffee

    Tea

    Milk

    An unordered list:

    Coffee

    Tea

    Milk

    Output;-

    An ordered list:1. Coffee2. Tea3. Milk

    An unordered list: Coffee Tea Milk

  • 8/13/2019 Web Tech Prog

    2/27

    2. Write HTML code to implement Table tag.

    Month

    Savings

    January

    $100

    February

    $80

    Output:-

    Month Savings

    January $100

    February $80

  • 8/13/2019 Web Tech Prog

    3/27

    3. Write a HTML code to implement img tag.

    This is Image of smile

    Output:-

  • 8/13/2019 Web Tech Prog

    4/27

    4. Write a HTML code to implement Frame.

    This is a Frame

    Output:-

  • 8/13/2019 Web Tech Prog

    5/27

    5. Write a HTML code to implement Form.

    This is a From

    First name:

    Last name:

    Click the "Submit" button and the form-data will be sent to a page on the server called .

    Output:-

    First name:Mickey

    Last name:Mouse

    Submit

    Click the "Submit" button and the form-data will be sent to a page on the server called.

  • 8/13/2019 Web Tech Prog

    6/27

    6. Write a CSS code to implement Background property.

    body

    {

    background-color:#b0c4de;

    }

    My CSS web page!

    Hello world! This is a W3Schools.com example.

    Output:-

  • 8/13/2019 Web Tech Prog

    7/27

    7. Write a CSS code to implement Text property.

    body {color:red;}

    h1 {color:#00ff00;}

    p.ex {color:rgb(0,0,255);}

    This is heading 1

    This is an ordinary paragraph. Notice that this text is red. The default text-color for a page is defined in the body

    selector.

    This is a paragraph with class="ex". This text is blue.

    Output:-

    This is heading 1

    This is an ordinary paragraph. Notice that this text is red. The default text-color for a page isdefined in the body selector.

    This is a paragraph with class="ex". This text is blue.

  • 8/13/2019 Web Tech Prog

    8/27

    8. Write a CSS code to implement Font property.

    p.normal {font-style:normal;}

    p.italic {font-style:italic;}

    p.oblique {font-style:oblique;}

    This is a paragraph, normal.

    This is a paragraph, italic.

    This is a paragraph, oblique.

    Output:-

    This is a paragraph, normal.

    This is a paragraph, italic.

    This is a paragraph, oblique.

  • 8/13/2019 Web Tech Prog

    9/27

    9. Write a CSS code for Table.

    table

    {

    border-collapse:collapse;

    }

    table, td, th

    {

    border:1px solid black;

    }

    Firstname

    Lastname

    Peter

    Griffin

    Lois

    Griffin

  • 8/13/2019 Web Tech Prog

    10/27

    Note: If a !DOCTYPE is not specified, the border-collapse property can produce unexpected results

    in IE8 and earlier versions.

    Output:-

    Firstname Lastname

    Peter Griffin

    Lois Griffin

    Note:If a !DOCTYPE is not specified, the border-collapse property can produce unexpected

    results in IE8 and earlier versions.

  • 8/13/2019 Web Tech Prog

    11/27

    10. Write a CSS code for Border.

    p.one

    {

    border-style:solid;

    border-width:5px;

    }

    p.two

    {

    border-style:solid;

    border-width:medium;

    }

    p.three

    {

    border-style:solid;

    border-width:1px;

    }

    Some text.

    Some text.

    Some text.

  • 8/13/2019 Web Tech Prog

    12/27

    Note: The "border-width" property does not work if it is used alone. Use the "border-style" property to set theborders first.

    Output:-

    Some text.

    Some text.

    Some text.

    Note:The "border-width" property does not work if it is used alone. Use the "border-style"property to set the borders first.

  • 8/13/2019 Web Tech Prog

    13/27

    11. Write a javascript code for output statement.

    var pi=3.14;

    var person="John Doe";

    var answer='Yes I am!';

    document.write(pi + "
    ");

    document.write(person + "
    ");

    document.write(answer + "
    ");

    Output:-

    3.14

    John Doe

    Yes I am!

  • 8/13/2019 Web Tech Prog

    14/27

    12. Write a javascript code for Function implementation.

    Click the button to call a function with arguments

    Try it

    function myFunction(name,job)

    {

    alert("Welcome " + name + ", the " + job);

    }

    Output:-

  • 8/13/2019 Web Tech Prog

    15/27

    13. Write a javascript code to implement if else statement .

    Click the button to get a time-based greeting.

    Try it

    function myFunction()

    {

    var x="";

    var time=new Date().getHours();

    if (time

  • 8/13/2019 Web Tech Prog

    16/27

    document.getElementById("demo").innerHTML=x;

    }

    Output:-

  • 8/13/2019 Web Tech Prog

    17/27

    14. Write a javascript code to implement while loop .

    Try it

    function myFunction()

    {

    var x="",i=0;

    while (i

  • 8/13/2019 Web Tech Prog

    18/27

  • 8/13/2019 Web Tech Prog

    19/27

    15. Write a javascript code to implement switch case statement .

    Click the button to display a message based on what day it is today.

    Try it

    function myFunction()

    {

    var x;

    var d=new Date().getDay();

    switch (d)

    {

    case 6:

    x="Today it's Saturday";

    break;

    case 0:

    x="Today it's Sunday";

    break;

    default:

    x="Looking forward to the Weekend";

    }

    document.getElementById("demo").innerHTML=x;

    }

  • 8/13/2019 Web Tech Prog

    20/27

    Output:-

  • 8/13/2019 Web Tech Prog

    21/27

    16. Write a javascript code to implement RequredFieldValidation .

    function validateForm()

    {

    var x=document.forms["myForm"]["fname"].value;

    if (x==null || x=="")

    {

    alert("First name must be filled out");

    return false;

    }

    }

    First name:

    Output:

  • 8/13/2019 Web Tech Prog

    22/27

  • 8/13/2019 Web Tech Prog

    23/27

    17. Write PHP code to implement print statement .

    Output:-

  • 8/13/2019 Web Tech Prog

    24/27

    18. Write PHP code to implement string.

    Output:-

  • 8/13/2019 Web Tech Prog

    25/27

    19. Write PHP code to implement Function.

    Output:-

  • 8/13/2019 Web Tech Prog

    26/27

    20. Write PHP code to implement Array.

    Output:-

  • 8/13/2019 Web Tech Prog

    27/27

    S.no. PROGRAM NAME Signature

    1 Write HTML code to Li tag .2 Write HTML code to implement Table tag.3 Write a HTML code to implement img tag.4 Write a HTML code to implement Frame.5 Write a HTML code to implement Form.6 Write a CSS code to implement Background property.7 Write a CSS code to implement Text property.8 Write a CSS code to implement Font property.9 Write a CSS code for Table.10 Write a CSS code for Border.11 Write a javascript code for output statement.12 Write a javascript code for Function implementation.13 Write a javascript code to implement if else statement .14 Write a javascript code to implement while loop .

    15 Write a javascript code to implement switch case statement .16 Write a javascript code to implement

    RequredFieldValidation .17 Write PHP code to implement print statement .18 Write PHP code to implement string.

    19 Write PHP code to implement Function.20 Write PHP code to implement Array.