bw83 Posted November 30, 2008 Share Posted November 30, 2008 Im working on a page and using an external sheet for the first time. I used the try it editor on w3 page at http://www.w3schools.com/css/tryit.asp?fil...ackground-color and it seemed to work fine <html><head><style type="text/css">body{background-color:000000;font:12pt "times new roman",times,serif;color:ffffff;}a:link,a:active,a:visited,a:hover{font:12pt "times new roman",times,serif;color:ffffff;text-decoration:none;}#header {background-color:transparent;height:100px;}#left { position: absolute; left: 15px; top: 160px; width: 200px; background-color:transparent; color: #FFFFFF; font-family: "Times New Roman", Times, serif; font-style: normal; font-size: medium;}#center { top: 0; margin-left: 230px; margin-right: 15px; background-color:transparent; color: #FFFFFF; font-family: "Times New Roman", Times, serif; font-style: normal; font-size: medium;}</style></head><body><div id="header">My header graphics</div><div id="left"><center>ACCP<br>Regulations<br>Personal Files<br>Links<br>Forms<br>Tools<br></center></div><div id="center">My content body</div></body></html> That is what im using on the editor and it shows up for what seems to be how I want it. Im going for a black background on the page with white font. I want a top header div and a left and right div for menu and main content. Here is what im using on my style sheet and main page for using the external <style type="text/css">body{background-color:000000;font:12pt "times new roman",times,serif;color:ffffff;}a:link,a:active,a:visited,a:hover{font:12pt "times new roman",times,serif;color:ffffff;text-decoration:none;}#header {background-color:transparent;height:100px;}#left { position: absolute; left: 15px; top: 160px; width: 200px; background-color:transparent; color: #FFFFFF; font-family: "Times New Roman", Times, serif; font-style: normal; font-size: medium;}#center { top: 0; margin-left: 230px; margin-right: 15px; background-color:transparent; color: #FFFFFF; font-family: "Times New Roman", Times, serif; font-style: normal; font-size: medium;}</style> <html><head><LINK href="stylesheet.css" rel="stylesheet" type="text/css"><title>B-Dubs Military Info</title></head><body><div id="header">My header graphics</div><div id="left"><center>ACCP<br>Regulations<br>Personal Files<br>Links<br>Forms<br>Tools<br></center></div><div id="center">My content body</div></body></html> Ive tried a few different changes for the external sheet and the best ive seemed to get what having a white background (while trying for black) but having my divs all have a black background but that only goes directly around the text not the whole page so it doesnt help. That was when i switched to a transparent background for the divs but cant geta black background on the whole page Link to comment Share on other sites More sharing options...
Sansespere Posted November 30, 2008 Share Posted November 30, 2008 EDIT: Deirdre's Dad got it. Link to comment Share on other sites More sharing options...
bw83 Posted November 30, 2008 Author Share Posted November 30, 2008 Sorry it may have been confusing how i wrote it... basically im just wondering why it works in the TryIt editor and not as a seperate style sheet... For right now im only trying for something simple... black background for the page with the 3 divs just having a transparent background and white font... It works in the editor but not when I have it as a seperate style sheet Link to comment Share on other sites More sharing options...
jeffman Posted November 30, 2008 Share Posted November 30, 2008 External style sheets don't use <style></style> tags. Take them out. Link to comment Share on other sites More sharing options...
bw83 Posted November 30, 2008 Author Share Posted November 30, 2008 Ty very much... Definately a mistake that shows it was my first time using the external sheet... I changed it and it worked like it was supposed to... Wont be making that mistake again Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.