Pages

Saturday 28 June 2014

Cascading Style Sheets(CSS)

What is CSS?

  • CSS stands for Cascading Style Sheets
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files 
Note :
Styles are normally saved in external .css files. External style sheets enable you to change the appearance and layout of all the pages in a Web site, just by editing one single file!

    How to Link HTML To CSS?

    1.how to open in Visual studio: 
    Ans-file -new -webpage- stylesheet(chose)
    2.how to link html page to css page:
    Ans-
      Css program
    .Textbox         //textbox present in html page using this we r access for color or anystyle
     {
      background-color:blue
       color:red
    }
    .Dropdown      //same(another properties)
    {
    border-button-color:Green;
    border-left-color:red;
    border-right-color:red;
    color:green;
    Note: We cam use N nomber of properties.
             Every properties before u use dot(.)Ex: .Textbox
    Sample code for how to wrtite css inside html:
    <!DOCTYPE html>
    <html>
    <head>
    <style>
    body
    {
    background-color:#b0c4de;
    }
    </style>
    </head>

    <body>

    <h1>My CSS web page!</h1>
    <p>Hello world! This is a W3Schools.com example.</p>

    </body>
    </html>

    JavaScript fundamentals questions with answers?

    JavaScript is a Scripting Language.A scripting language is a lightweight programming language.
    ->It is a client side scripting language.
    ->javascript is a object based scripting langauge.
    ->Java script supported 
     data type(DT), variable, if else ,else if, for, while,do while,switch,operation .function, array,object
    ->Java script is a loosely typed program(did not take any data type like int,bool,char)
    ->var is used to over come this
    Note: class .inheritance,polymorphisim...etc not supported.

    Where you write java script in html page?

    Ans:
    <html>
    <head>
    <script language="JavaScript" type="text/JavaScript">
    -----
    ------
    ------
    ------
    </script>
    </head>
    </html>

    write a program add two number using java script?

    ans:
    <html>
    <head>
     <script language="JavaScript" type="text/JavaScript">
     var v4=10;   //global variable
     Function fnadd(v1,v2)
    {
      var v3=v1+v2;
      return v3;
    }
    Function fnsub(v5,v6)
      var v7=v5-v6;
     return v7;
    }
    </script>
    </head>

    write a program add two number  and print using java script?

    <html>
    <head>
     <script language="JavaScript" type="text/JavaScript">
     var v4=10;   //global variable
     Function fnadd(v1,v2)
    {
      var v3=v1+v2;
      return v3;
    }
    Function fnadd()
    {
     var res=f1(2,3);
    document.write(res);
    alert(res);
    }
    </script>
    </html>

    Creating Array using java script 

    <script language="JavaScript" type="text/JavaScript">
    var sname=new array();
     sname[0]="ritesh";
     sname[1]="rakesh";
     sname[2]="sss";
     sname[3]="shakti";
    Function fnprint()
    {
       debugger;   // its like break point(but we have to setting in browser[tool-internet-option-advance- disable -                          //script  debug chose internet option)
      for(i=0; i<sname.length;i++)
    {
      alert(sname[i]);
    }
    </script>

    Creating JavaScript Objects

    <script>
    var person=new Object();
    person.firstname="John";
    person.lastname="Doe";
    person.age=50;
    person.eyecolor="blue";
    document.write(person.firstname + " is " + person.age + " years old.");
    </script>

    If...else Statement

    <script>
    function myFunction()
    {
    var x="";
    var time=new Date().getHours();
    if (time<20)
      {
      x="Good day";
      }
    else
      {
      x="Good evening";
      }
    document.getElementById("demo").innerHTML=x;
    }
    </script>

    If...else if...else Statement

    if (time<10)
      {
      x="Good morning";
      }
    else if (time<20)
      {
      x="Good day";
      }
    else
      {
      x="Good evening";
      }

     exception handling in javascript

     <!DOCTYPE html>
    <html>
    <head>
    <script>
    var txt="";
    function message()
    {
    try
      {
      adddlert("Welcome guest!");
      }
    catch(err)
      {
      txt="There was an error on this page.\n\n";
      txt+="Error description: " + err.message + "\n\n";
      txt+="Click OK to continue.\n\n";
      alert(txt);
      }
    }
    </script>
    </head>

    <body>
    <input type="button" value="View message" onclick="message()" />
    </body>

    </html>

    html fundamentals questions with answers?

    Introduction to HTML:
    1.HTML developed by W3ORG (word word word organization)
    2.&nbps,&nbps ...:used for space between two line
    3.<head><title>wecome</title></head>  //used for heading
    4.<lable id ="lbname" >Nmae:</lable>  //in oreder to display plain text ,it is better to use label text.
    5.<link rel ="stylesheet" type="text/css" href="filename.css">  //link html file to css file.
    6.align is used for which postion u want to place ur text like left ,right...

    1.What is HTML?

    HTML is a language for describing web pages.
    • HTML stands for Hyper Text Markup Language
    • HTML is a markup language
    • A markup language is a set of markup tags
    • The tags describe document content
    • HTML documents contain HTML tags and plain text
    • HTML documents are also called web pages. 

    2.HTML Tags

    HTML markup tags are usually called HTML tags
    • HTML tags are keywords (tag names) surrounded by angle brackets like <html>
    • HTML tags normally come in pairs like <b> and </b>
    • The first tag in a pair is the start tag, the second tag is the end tag
    • The end tag is written like the start tag, with a forward slash before the tag name
    • Start and end tags are also called opening tags and closing tags

    3.Writing HTML Using Notepad or TextEdit

    HTML can be edited by using a professional HTML editor like:
    • Adobe Dreamweaver
    • Microsoft Expression Web
    • CoffeeCup HTML Editor.

    4.HTML Links

    HTML links are defined with the <a> tag
     <a href="http://www.w3schools.com">This is a link</a>

    5.HTML Images

    HTML images are defined with the <img> tag.
    <img src="imagename.jpg" width="104" height="142">

    6.The HTML <style> Element

    The <style> tag is used to define style information for an HTML document.
    Inside the <style> element you specify how HTML elements should render in a browser:
    how to write:
    <head>
    <style type="text/css">
    body {background-color:yellow}
    p {color:blue}
    </style>
    </head>

    7.HTML Style Example - Background Color

    The background-color property defines the background color for an element:
    <body style="background-color:yellow;">
    <input type ="buttom" id ="btnbuttom" value="submit" style="background-color:black;color:white">

    8.HTML Tables:

    <table border="1">
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>

    9.HTML Table Headers

    Header information in a table are defined with the <th> tag.
    All major browsers display the text in the <th> element as bold and centered.
    <table border="1">
    <tr>
    <th>Header 1</th>
    <th>Header 2</th>
    </tr>
    <tr>
    <td>row 1, cell 1</td>
    <td>row 1, cell 2</td>
    </tr>
    <tr>
    <td>row 2, cell 1</td>
    <td>row 2, cell 2</td>
    </tr>
    </table>

    10.HTML Unordered Lists

    An unordered list starts with the <ul> tag. Each list item starts with the <li> tag.
    The list items are marked with bullets (typically small black circles).
    <ul>
    <li>Coffee</li>
    <li>Milk</li>
    </ul>

    11.HTML Ordered Lists

    An ordered list starts with the <ol> tag. Each list item starts with the <li> tag.
    The list items are marked with numbers
    <ol>
    <li>Coffee</li>
    <li>Milk</li>
    </ol>

    12.The HTML <div> Element

    The HTML <div> element is a block level element that can be used as a container for grouping other HTML elements.
     The <div> element has no special meaning. Except that, because it is a block level element, the browser will display a line break before and after it.
    When used together with CSS, the <div> element can be used to set style attributes to large blocks of content.
    Another common use of the <div> element, is for document layout. It replaces the "old way" of defining layout using tables. Using <table> elements for layout is not the correct use of <table>. The purpose of the <table> element is to display tabular data.
    Example:

    <!DOCTYPE html>
    <html>
    <body>

    <div id="container" style="width:500px">
    <div id="header" style="background-color:#FFA500;">
    <h1 style="margin-bottom:0;">Main Title of Web Page</h1></div>

    <div id="menu" style="background-color:#FFD700;height:200px;width:100px;float:left;">
    <b>Menu</b><br>
    HTML<br>
    CSS<br>
    JavaScript</div>
    <div id="content" style="background-color:#EEEEEE;height:200px;width:400px;float:left;">
    Content goes here</div>
    <div id="footer" style="background-color:#FFA500;clear:both;text-align:center;">
    Copyright © http://pravatdotnet.blogspot.in/</div>
    </div>
    </body>
    </html>

    13.HTML Forms and Input

     1.For TextBox:               Username: <input type="text" name="user"><br>
    2.For Text in psd format: Password: <input type="password" name="password">
    3.For Radio Button:        <input type="radio" name="sex" value="male">Male<br>
    4.For CheckBox:           <input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
    5.For TextArea:            <textarea rows="10" cols="30">
    6.Text and inside comment: <input type="text" name="name" value="your name"><br>
    7.
    14.How to create a drop-down list with a pre-selected value
    <form action="">
    <select name="cars">
    <option value="volvo">Volvo</option>
    <option value="saab">Saab</option>
    <option value="fiat" selected>Fiat</option>
    <option value="audi">Audi</option>
    </select>

    15.HTML Iframes 

    An iframe is used to display a web page within a web page
    Syntax for adding an iframe:
    <iframe src="URL"></iframe>

    <iframe src="demo_iframe.htm" width="200" height="200"></iframe> 
    Target to a link: 
    <iframe src="demo_iframe.htm" name="iframe_a"></iframe>
    <p><a href="http://www.w3schools.com" target="iframe_a">W3Schools.com</a></p>

    Friday 27 June 2014

    How to Install MySQL On Your Local Machine

    mysql.com documents the steps required to install MySQL on Windows and Mac. To install MySQL, you can get the installer here. On a Mac, it is as easy as downloading a disk image, double clicking to install, and then stepping through the installation process.

    The Mac disk image also comes with a startup package which will automatically launch MySQL when you start your computer. Additionally, it adds a convenient menu in the System Preferences for managing MySQL:



    After you setup MySQL, you can set the root MySQL account from the command line by issuing the command: