Jump to content

External style sheet


bw83
 Share

Recommended Posts

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...