Forum Moderators: not2easy

Message Too Old, No Replies

external css trail

         

Geoffrey james

7:00 am on Jul 29, 2006 (gmt 0)

10+ Year Member



hey all,

please dont laugh at my question!

Im trying to figure out how to create an external style sheet. When i preview in browser i get nothing. WHY?

here is the simple css i put together in a file called main1.css

div {
border: 1px solid Black;
}
body {
margin: 0 auto;
width: 700px;
}
#navigation {
float: left;
width: 150px
}
#content1 {
float: right;
width: 150px;
}
#content2 {
margin-left: 152px;
margin-right: 152px;
}
#footer {
clear: both;
}

and here is how I have set up my page that is supposed to link to it:

<link rel="stylesheet" type="text/css" title="style" href="main1.css" media="screen" />

It may sound silly but what is happening and why am I not getting anything?

Thanks geoff

DanA

7:44 am on Jul 29, 2006 (gmt 0)

10+ Year Member



Try
<link rel="stylesheet" href="main1.css" type="text/css" /> if main1.css is in the same folder as your html file.
Do you test with firefox and ie?
If it doesn't work with firefox but works with ie, it may be a server configuration (wrong MIME).
There may be other reasons. Which is the name of the file?
Maybe you could post the html.

Geoffrey james

12:10 pm on Jul 29, 2006 (gmt 0)

10+ Year Member



have followed the steps you surgested, but to no avail.

not sure why its not working.

the css file is in the same folder too.

does a CSS file need to be uploaded onto server for it to work? at the moment I have the css and the page that im wanting the css to work on just on my computer system!

geoff

Robin_reala

12:38 pm on Jul 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have you validated your HTML [validator.w3.org] and CSS [jigsaw.w3.org] to check that there's no syntax problems you might be coming up against (e.g. missing semicolons, unclosed elements, etc)?

DanA

12:59 pm on Jul 29, 2006 (gmt 0)

10+ Year Member



After validation give more precisions :
not sure why its not working.

with firefox, IE, both?
What is your page extension? (html, php, asp...)
does a CSS file need to be uploaded onto server for it to work?

No it works on any computer system.

[edited by: DanA at 1:00 pm (utc) on July 29, 2006]

Geoffrey james

1:19 pm on Jul 29, 2006 (gmt 0)

10+ Year Member



no errors or warnings found.in both css and page.

page extension is html

?

Geoff

DanA

2:30 pm on Jul 29, 2006 (gmt 0)

10+ Year Member



Post the html then.