Jump to content

need help on how to make a external CSS file


brevardcountypcr

Recommended Posts

ok thank youbut one thing i was confused on it
<html><head><style type="text/css">body{background-color:#d0e4fe;}h1{color:orange;text-align:center;}p{font-family:"Times New Roman";font-size:20px;}</style></head><body><h1>CSS example!</h1><p>This is a paragraph.</p></body></html>

see i want to make a external css file but it just show the code above when use the tryit editor on the site . that confused me i throught i would have to do a html document when i make it ?

Link to comment
Share on other sites

That there is called a Internal Style Sheet. You can do that. Basically three ways to add CSS: Inline Style, Internal Style Sheet, and External Style Sheet(Recommended). External:

<head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head>

Internal(like what you pasted):

<head><style type="text/css">hr {color:sienna;}p {margin-left:20px;}body {background-image:url("images/back40.gif");}</style></head>

Inline:

<p style="color:sienna;margin-left:20px">This is a paragraph.</p>

That is a HTML document. Maybe you're use to seeing this:

<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head><body><h1>CSS example!</h1><p>This is a paragraph.</p></body></html>

The mystyle.css would have all your styling for that page(s). mystyle.css (just an example):

body (background-color: lightblue;} p {  color: grey;  text-indent: 50px;} h1 {background-color: yellow;}

Edited by Don E
Link to comment
Share on other sites

That there is called a Internal Style Sheet. You can do that. Basically three ways to add CSS: Inline Style, Internal Style Sheet, and External Style Sheet(Recommended). External:
<head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head>

Internal(like what you pasted):

<head><style type="text/css">hr {color:sienna;}p {margin-left:20px;}body {background-image:url("images/back40.gif");}</style></head>

Inline:

<p style="color:sienna;margin-left:20px">This is a paragraph.</p>

That is a HTML document. Maybe you're use to seeing this:

<!DOCTYPE html><html><head><link rel="stylesheet" type="text/css" href="mystyle.css" /></head><body><h1>CSS example!</h1><p>This is a paragraph.</p></body></html>

The mystyle.css would have all your styling for that page(s). mystyle.css (just an example):

body (background-color: lightblue;} p {  color: grey;  text-indent: 50px;} h1 {background-color: yellow;}

ok thank you so much don. i was just so confused what i have to put in the external css file. just the way you explained the mystyle.css example that the way all externals should be is that correct ?
Link to comment
Share on other sites

Yes, basically.
thank you but i found this page from my college years
/*   New Perspectives on HTML and XHTML 5th Edition   Tutorial 4   Tutorial Case   Online Scrapbooks Style Sheet   Author:   Date:     Filename:		 scraps.css   Supporting Files: back.jpg, bullet.jpg*/body	   {margin: 0px; color: brown;		    background: white url(back.jpg) repeat-y}h1, h2, h3 {font-family: Arial, Helvetica, sans-serif; color: orange}h1		 {border-bottom: 2px solid orange; background-color: white; margin: 0px; padding: 0px}ul		 {margin-top:0px}#outer_container   {width: 780px}#head			  {text-align: right}#links			 {float: left; width: 200px}#article		   {margin-left: 200px}#pullout		   {float: right; width: 250px; margin: 0px 0px 10px 10px;				    border: 5px outset orange; background-color: ivory;				    font-size: 10pt; font-family: Arial, Helvetica, sans-serif}address		    {text-align: center; font-style: normal; font-variant: small-caps;				    border-top: 2px solid orange; color: orange}

what is the biggest/max px size i can make it ?

Link to comment
Share on other sites

  • 3 months later...
  • 2 weeks later...
what is the biggest/max px size i can make it ?
??? I ready answered this before! THERE IS NO MAX/BIGGEST SET SIZE, again it like asking "how long is a piece of string" answer "about as long as you decided to make it", another clue, if it extends beyond window width of YOUR browser, causing scrollbars to appear, THEN it is probably to wide FOR YOUR browser window.
somehow my extenal sheet it not working what i did wrong ???
Only reply we can give is "yes! I guess you must have done something wrong"
Link to comment
Share on other sites

??? I ready answered this before! THERE IS NO MAX/BIGGEST SET SIZE, again it like asking "how long is a piece of string" answer "about as long as you decided to make it", another clue, if it extends beyond window width of YOUR browser, causing scrollbars to appear, THEN it is probably to wide FOR YOUR browser window. Only reply we can give is "yes! I guess you must have done something wrong"
Okay thank you. I have another question can I put a color background behind my background picture that is already showing ??? Like this for a example http://www.brevardco.../Ps3repair.html
Link to comment
Share on other sites

  • 2 weeks later...
Your doctype declaration is wrong try <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">, if you use css3 background-size it seems you can't use shorthand 'background:' on its own?
Can someone explain to me about the !doctypes because my teacher from college never explained it to me ? And when the best time to use each one .
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
×
×
  • Create New...