Background color dissappeared and text colours gone black
Hi, I changed <stylesheet type="text/css> to <link rel="stylesheet" style type="text/css" href="styles.css"> so that I could try put the CSS in a external style sheet. But now the text that was red and yellow, has turned black, and the black background has dissapeared.
I made a folder and called it styles.css. then a text file in the styles.css folder called mainstyles.css
The code in the mainstyles.css file is body{background-color:black;margin:0px;}
and h1 {color:red} Nothing is happening.
Also spufi, chreyani major payne, when I click right click on image the address is c:/users/spencer/Desktop/images
Is this right, cause I heard that you cant have a path Desktop.
How do I change this and to what.
if you are having .css file named style.css that exist in a folder named 'css'
what you have to write in your html file is this:
<link href="css/style.css" rel="stylesheet" type="text/css"/>
another thing you should know about HTML is that you have the <base></base> tags.
you can define a base url for you site. (between the <head> tags)
<base href="http://www.example.com/images/" target="_blank" />
and now if you put a <img src="smily.jpg" alt="example" />
will be the same as <img src="http://www.example.com/images/smily.jpg">
just remember this option exists.
Must I delete all the internal css in order for the external to work
Hi chryaner, still not working, must I delete all the internal css first maybe, Its all a faint black now since I put link in to external css.
I put this in <link href="stylesheet" style type="text/css" href="mainstyles.css/style.css"/>
I tried putting styles.css/mainstyles.css in aswell, still doesnt work.
The mainstyles.css text file is in the styles.css folder.
The text color hasnt changed to red still and the background still hasnt gone to black.
Hi chryaner, still not working, must I delete all the internal css first maybe, Its all a faint black now since I put link in to external css.
I put this in <link href="stylesheet" style type="text/css" href="mainstyles.css/style.css"/>
I tried putting styles.css/mainstyles.css in aswell, still doesnt work.
The mainstyles.css text file is in the styles.css folder.
The text color hasnt changed to red still and the background still hasnt gone to black.
if the path of the css file is "c:\folder\anotherfolder\yoursite\css\style.css"
your html must be one folder down : "c:\folder\anotherfolder\yoursite\indexhtml"
change you folder's name to "css" and not "mainstles.css" it may be causing error
here is a tutorial for three ways to insert css. read it carfully.
the must correct structure of folders to a site is:
index.html as you main html file
css folder - all of your css files
js folder - all of you js files
images folder - all of your images
Bookmarks