Saved Bookmarks
| 1. |
Solve : Externale css help? |
|
Answer» When I make my .css file for my Externale css am I right I do the code LIKE this? am I right I do the code like thisNo. See here: http://www.w3schools.com/css/default.asp Quote And I save this file asThis bit is correct.Not this: Code: [Select]<HTML> ] body-color=black text-color=white ] </html> this: Code: [Select]body { background-color: black; color: white; } Here's a good place to go for reference: http://www.w3.org/TR/CSS21/#minitocWell I think I get it but let me start small. I will just put the code to change the Text and Body Color. In the roberts.css file I would type { body-color=black } text-color=white } Is this right?NO. Read the posts above.Honestly, i dont see much of a need to use CSS for such a simple style that can be done using HTML directly. Its one less file to worry about anyway. But assuming that you still want to do this using CSS, you must define the "Body" before your properties. In CSS, the tag that you use "body" refers to the HTML tag , The CSS code that you use to style it will apply to everything between and so, as a seperate "filename".css file, the code would be as such posted above. However, if you want to integrate your CSS into the HTML webpage itself, you would do this: (doing so means it does not require the stylesheet file) Code: [Select]<style type="text/css"> body { background-color: black; color: white; } [code] </style> You probably have figured it out, considering that the topic is old, however, i would like to post for anyone else who also wants to know. Quote from: zeroburn on APRIL 22, 2012, 07:08:42 PM Honestly, i dont see much of a need to use CSS for such a simple style that can be done using HTML directly. http://duckduckgo.com/?q=why+it+is+best+practise+to+use+CSS Using external css is extremely important when you have a website with large number of pages. If you don't use external css file, then if in future u would have to change the styles of your pages, you gonna have to go through every page. Now to answer the main question of nymph4, i think this will help. Your CSS File Code: [Select]charset "UTF-8"; body { background-color:Black ; color: white; } save it as you wanted to, i.e "roberts.css" Your HTML file Code: [Select]<html> <head> <title>Motsim</title> <link href="roberts.css" rel="stylesheet" type="text/css"/> </head> <body> Here is your Content. </body> </html> This is how you do it. Hope this helps. Regards, MotsimThere is that truth. |
|