CSS Sheet not being read for some reason??

C

cayenne

Hello all.
I've got a very simple style sheet. It is named page1_body.css. It is
in the same directory as my index.html file.

Style sheet looks like:


div.title {
font-family: arial,courier;
color: #A52A2A;
border :1px;

}

My beginning of the index.html file is:

<html>

<head>
<link REL="StyleSheet" HREF="page1_body.css" type="text/css">

</head>

<body>


<div class="title">
text here
</div>

</body>
</html>

I've simplified a page I'm starting on at home...to these simple
lines. And yet...the css page does NOT seem to be being read at
all...at the very least...I would expect to see a border drawn around
the box of the text.

Absolutely nothing.

If in the URL, I type in the .css page instead of the .html page...it
displays the stylesheet text in my browser...so, I would guess both
pages are accessible.

Anyone have any ideas what the problem is here? I've played with this
on a similar machine...apache2, Gentoo Linux...it all works on that
machine...but, on this one...nothing. I'm hitting it on both machines
as local host....and have also tried it with my IP address on the home
box. Still, it just seems for some damned reason, the index.html file
is not pulling in the link file for the .css file.

Any ideas/suggestions/links to info greatly appreciated!

chilecayenne
 
L

Leif K-Brooks

cayenne said:
I've got a very simple style sheet. It is named page1_body.css. It is
in the same directory as my index.html file.
I've simplified a page I'm starting on at home...to these simple
lines. And yet...the css page does NOT seem to be being read at
all...at the very least...I would expect to see a border drawn around
the box of the text.

Could be because you aren't specifying a border color or type. URL?
 
T

Toby A Inkster

cayenne said:
Still, it just seems for some damned reason, the index.html file
is not pulling in the link file for the .css file.

It sounds like the CSS file is being served with the wrong MIME type, but
we'd need to see a URL for sure.

Also: <div class="title">. What is wrong with <h1>???

Also: "font-family: arial,courier;". An interesting combination!
 
J

Jukka K. Korpela

Leif K-Brooks said:
Could be because you aren't specifying a border color or type.

Actually (s)he is, since
border :1px;
sets those properties as well. Using the border shorthand _always_ sets all
the sub-properties border-width, border-style, border-color. Anything not
listed in the rule is set to its initial value as specified in the CSS
specification. For border-color that means the color of the element and for
border-style it means none.

So in practical terms, the shorthand is part of the problem, but technically
it sets border-style, namely to none, even overriding any eventual setting
in some previous rule.

Indeed, a URL is needed. If the material posted tells the whole story, we
know that conforming browsers shall _not_ draw a border, since border-style
is definitely set to none. But we probably haven't seen the whole story, and
we cannot tell what happens with the other rules etc.

Why, oh why, don't people take the simple action of posting a URL in their
original questions, speeding things up a lot when others try to help them in
their problems?
 
R

Ryan Stewart

Toby A Inkster said:
It sounds like the CSS file is being served with the wrong MIME type, but
we'd need to see a URL for sure.

Also: <div class="title">. What is wrong with <h1>???

Also: "font-family: arial,courier;". An interesting combination!
In my experience, the built-in header tags (h1, h2, etc) create sometimes
unwanted vertical white space below them.
 
S

Steve Pugh

Ryan Stewart said:
In my experience, the built-in header tags (h1, h2, etc) create sometimes
unwanted vertical white space below them.

And?
CSS is being used to suggest a presentation here.
So CSS can be used to suggest that h1 has no margins.

Steve
 
T

Toby A Inkster

Ryan said:
In my experience, the built-in header tags (h1, h2, etc) create sometimes
unwanted vertical white space below them.

h1 {
padding-bottom: 0;
margin-bottom: 0;
/* or whatever you want */
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top