Powered by Blogger.

Thursday 12 January 2017

Using multiple classes within one selector


HTML allows you to add multiple classes to an HTML element. For example you can add two classes in to an <h1> .





Two different classes are written within the same attribute with spaces separating each class as above image shows.

 The advantage of using multiple classes within the same attribute is that you can write a CSS properties to select either of the classes and they both affect the same element. as like this







You can also write a same CSS properties/rules for  two different classes by written directly after each another as like this.


Wednesday 11 January 2017

GET and POST method in HTML


HTML forms can use method by specifying method="POST" and method="GET" in <form> elemen.
GET method:
Appends form data into the URL in name/value pairs formet.
URL is limited in range 3000 characters


POST method:
No size limitations for the URL
Data is not shown is in URL
POST cannot be bookmarked

Wednesday 4 January 2017

How To Use CSS3 Media Queries To Create a website mobile friendly


What are media queries ?
Media queries are CSS technique introduced in CSS3 and used for responsive web design it use @media to include a block of css properties. 
How to use ?
We can set the set the screen size by using @media 
Example:
If the screen size web browser is smaller then 667px , the background color of body will be yellow:
/* Less than 667px */
See the screenshot for code.








Example #2:
If the screen size web browser is larger then 667px , the background color of body will be red:
/* grater than 667px */
See the screenshot for code.








Example #3:
If the screen size web browser is in between 480px and 667px , the background color of body will be yellow:

/* No greater than 667px, no less than 480px */
See the screenshot for code.




Tuesday 3 January 2017

Linking a separate css file to HTML


Today you will learn how to link CSS file to HTML  document. Your style/CSS rules/properties are contained in a single file that is saved with the extension .css. You link to it directly from each HTML document/file.
This is just simple that you put line in between <head></head> of HTML file.
see bellow screenshot




Note:
Make sure the correct path  in the href=""
If the css file is  in the same folder where your html file is then no need any path just write the file name.
Or if the css file is present in different folder then pacify the location/path example  href="foldername/filename.css"


If any query please leave a comment or contact me. Thank You

Monday 2 January 2017

How to set background color in HTML page


There are different ways to set background color in HTML page.
First:
Add <style></style> tag in your HTML document to set background color and then write the css property inside the <style></style>

See image bellow to learn more easily















2nd:
The second way to set background color is the inline coding. write CSS property with the HTML tag by add style="" in HTML document.

See image bellow to learn more easily









3rd:
The third way to set background color is by linking an external CSS file with HTML.Create a new file with .css extension and then identify the HTML tag or Class and apply CSS property.