+ 3

Where can write css part in the android text editor??

I am an intern in cording and am using android editor,so am always getting confusing on where do I suppose to write css part in my coding. Is it in the <head> or <style> or some where else? I really need your help plss.

13th Feb 2018, 9:56 AM
Abubakar Suraja
Abubakar Suraja - avatar
2 Answers
13th Feb 2018, 10:22 AM
Vukan
Vukan - avatar
+ 3
Hello Abubakar, There is more than one way: 1. you could write them inline; (in the element that needs styling. NOT RECOMMENDED!) Ex: <div styles='width: 100px; height: 50px'>....</div> 2. you could write them in the <head> inside a <styles> tag; (More used in testing and simple html pages.) Ex: <head> <styles> .testing{ width: 100px; height: 50px; } </styles> </head> <body> <div class='testing'></div> ... <div></div> </body> 3. (RECOMMENDED WAY) put it in a separate file and link it in the <head> section. Ex: // this is a file styles.css .testing { width: 100px; height: 50px; } // this is the html page <head> <link rel='stylesheet' href='styles.css'> </head> <body> <div class='testing'>...</div> .... <div>...</div> </body>
13th Feb 2018, 10:29 AM
Ulisses Cruz
Ulisses Cruz - avatar