Posts

Showing posts from February, 2023

How to style HTML files using CSS???

Image
 Do you want to describe your html file and display it on the web page with some styles. If your answer is yes…. Just use CSS… What is CSS? CSS is expanded as Cascading Style sheets which allows the user to style your web pages. How to do it??? The user follows the syntax Selector  { Property1: Value1; …………; Property n:Value n;} You can add the CSS code to style your web pages by three types. They are as follows ·        Inline CSS ·        Internal CSS ·        External CSS Now, each and every CSS type is explained with code. Inline CSS: This is the simple way of adding styles to your html document. There is an element called “Style” in paragraph and heading style tags.   You can set the properties with some value for this method. Program: <!DOCTYPE html> <html> <body> <h2 style="color:red;"> This is the example of Inline...

Forms in html - How to get the User information??

 Forms are the interesting feature of HTML. This gets input from the user and sends it to the server for processing. Tag used : <form> It has many elements ·        <input> ·        <label> ·        <select> ·        <textarea> ·        <button> ·        <fieldset> ·        <legend> ·        <datalist> ·        <output> ·        <option> ·        <optgroup> A sample coding  is explained as follows. This form gets the firstname and lastname of a user,gender and email id. This form gets the user  details and click the submit button. Example: Form to ...

HTML attibutes-

 Attribute are the values to HTML elements which are generally specified in the start tag. It has some values to be assigned in the form of “attribute= value” The commonly used attributes are given below. <html> tag lang attribute Lang is the attribute which sets the displaying language of the webpage. It has variety of language support. Generally, we prefer English. It can be represented by “en”. If the US English is your   option,set the lang option as “en-US”. Examples are given below <html lang=”en”> When you want the united states English, use this <html lang=”en-US”>. When you want to set native languages like tamil,telugu,hindi Use   Lang=”ta”   ( for tamil) Lang =”te” (for telugu) Lang=”hi”   (for hindi)   <img> tag attributes   <img> tag is used to include image in the webpage. For that, use “src” attribute to get the URL of image. For setting height and width, the syntax is as ...

HTML tutorial - DOCTYPE declaration

 The first line of html coding is to specify the document type. Document type is declared by the keyword  <! DOCTYPE               > A sample program is given below. <!DOCTYPE html> <html> <head>  <title> This is the first HTML program </title> </head> <body> This is the sample content </body> </html> save this file as "sample.html" in notepad. Open the file in any browser like google chrome, Internet explorer/edge, firefox, safari and opera browser. It shows the webpage as a window with the text "This is the sample content". Alternate versions: when you are using other versions of HTML or XHTML, it has some different syntax to follow.... First, the syntax of html 4.01 version is given below..  Syntax: <!DOCTYPE html PUBLIC  "-//W3C//DTD HTML 4.01 transitional//EN"                       "URL of DT...

Html tags part 2- headings,paragraph,formatting

    Tags which is used to display various types of heading, paragraphes and text formats like bold,italic are  explained with some examples.  <h1>,<h2>,<h3>,<h4>,<h5>,<h6> tags    These are used to display the heading in differnet sytles. Starting from h1 to h6, the size is decreased. <!DOCTYPE html> <html> <head> Sample program</head> <body> <h1> Welcome </h1> <h2> Welcome </h2> <h3> Welcome </h3> <h4> Welcome</h4> <h5> Welcome </h5> <h6> Welcome </h6> </body> </html> output will be    Sample program  Welcome  Welcome   Welcome   Welcome   Welcome  Welcome Next, for displaying paragraph, <p> tag is used. <p> tag:        Do you want to insert a set of words, passages and paragraphs in a page . If your answer yes,use...