Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   HTML (http://www.velocityreviews.com/forums/f31-html.html)
-   -   CSS inlusion does not work (http://www.velocityreviews.com/forums/t157178-css-inlusion-does-not-work.html)

John Smith 02-17-2004 08:33 AM

Re: CSS inlusion does not work
 
I had a similar problem,
I solved this by changing the order of the attributes.

Try this:
<link rel="stylesheet" type="text/css" href="main.css">

Why or how don't ask me the only way I figured this out was that some of my
pages worked and others didn't and this was the difference!


"Matthias Pospiech" <matthias.pospiech@gmx.de> schreef in bericht
news:c0sj1s$j36$04$1@news.t-online.com...
> IF I try to set style settings inside a file they are not recognised, only
> if they are directly inside to main html file.
> Here an example: The body settings for Font are only used if inside the

main
> file, not if inside the css file:
>
> <html>
> <!------------------------------ HEAD ---------------->
> <head>
> <title>Matthias Pospiech</title>
> <link href="main.css" rel="stylesheet" type="text/css">
> <style type="text/css">
> </style>
> </head>
>
> <!------------------------------ BODY ---------------->
> <body>
> Text
> </body>
> </html>
>
>
> // CSS - Style: Main Settings
>
> body {
> font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
> font-size : 100%;
> background-color : #FFFFFF;
> color : #000000;
> margin: 0px 0px 0px 0px;
> padding:0px;
> }
>
> This means that I cannot use style sheet files ! I tried in Opera and
> Mozilla.
>
> Matthias Pospiech
>




Matthias Gutfeldt 02-17-2004 09:09 AM

Re: CSS inlusion does not work
 
Matthias Pospiech wrote:
> IF I try to set style settings inside a file they are not recognised, only
> if they are directly inside to main html file.
>
> <link href="main.css" rel="stylesheet" type="text/css">


What's the URL so we can see what you're really doing?
Are you sure the HREF attribute points to the correct folder and file?
Does the server send the correct MIME type for the stylesheet?


Matthias


Matthias Pospiech 02-17-2004 09:28 AM

CSS inlusion does not work
 
IF I try to set style settings inside a file they are not recognised, only
if they are directly inside to main html file.
Here an example: The body settings for Font are only used if inside the main
file, not if inside the css file:

<html>
<!------------------------------ HEAD ---------------->
<head>
<title>Matthias Pospiech</title>
<link href="main.css" rel="stylesheet" type="text/css">
<style type="text/css">
</style>
</head>

<!------------------------------ BODY ---------------->
<body>
Text
</body>
</html>


// CSS - Style: Main Settings

body {
font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
font-size : 100%;
background-color : #FFFFFF;
color : #000000;
margin: 0px 0px 0px 0px;
padding:0px;
}

This means that I cannot use style sheet files ! I tried in Opera and
Mozilla.

Matthias Pospiech


rf 02-17-2004 10:54 AM

Re: CSS inlusion does not work
 

"Matthias Pospiech" <matthias.pospiech@gmx.de> wrote in message
news:c0sj1s$j36$04$1@news.t-online.com...
> IF I try to set style settings inside a file they are not recognised, only
> if they are directly inside to main html file.
> Here an example: The body settings for Font are only used if inside the

main
> file, not if inside the css file:


<snip code>

As usual a URL is essential. Copy/pasted stuff *always* looses something
vital.

I'll just be you have this as the first line of your CSS file:

<style type="text/css">

Cheers
Richard.



Barry Pearson 02-17-2004 11:22 AM

Re: CSS inlusion does not work
 
Matthias Pospiech wrote:
> Matthias Gutfeldt wrote:

[snip]
>> Does the server send the correct MIME type for the stylesheet?

> How can I check that ?

[snip]

This is useful - put the URL of the CSS in:
http://web-sniffer.net/

--
Barry Pearson
http://www.Barry.Pearson.name/photography/
http://www.BirdsAndAnimals.info/
http://www.ChildSupportAnalysis.co.uk/



Matthias Pospiech 02-17-2004 11:35 AM

Re: CSS inlusion does not work
 
Matthias Gutfeldt wrote:

> Matthias Pospiech wrote:
>> IF I try to set style settings inside a file they are not recognised,
>> only if they are directly inside to main html file.
> >
>> <link href="main.css" rel="stylesheet" type="text/css">

>
> What's the URL so we can see what you're really doing?

Its locally on my computer.
> Are you sure the HREF attribute points to the correct folder and file?

Yes, if I include the .container (see below) and set the text inside a <div
class="container"> it works
> Does the server send the correct MIME type for the stylesheet?

How can I check that ?

Matthias


-------------------------------------
..container {
width: 700px;
border: 0px solid gray;
margin: 0px;
margin-left: auto;
margin-right: auto;
padding: 0px;
background-color : #F0F0F0;
}


Matthias Pospiech 02-17-2004 11:36 AM

Re: CSS inlusion does not work
 
John Smith wrote:

> I had a similar problem,
> I solved this by changing the order of the attributes.
>
> Try this:
> <link rel="stylesheet" type="text/css" href="main.css">
>
> Why or how don't ask me the only way I figured this out was that some of
> my pages worked and others didn't and this was the difference!


It does not make a difference.

Matthias

SteW 02-17-2004 11:39 AM

Re: CSS inlusion does not work
 
Matthias Pospiech wrote:
> IF I try to set style settings inside a file they are not recognised, only
> if they are directly inside to main html file.
> Here an example: The body settings for Font are only used if inside the main
> file, not if inside the css file:
>
> <html>
> <!------------------------------ HEAD ---------------->
> <head>
> <title>Matthias Pospiech</title>
> <link href="main.css" rel="stylesheet" type="text/css">
> <style type="text/css">
> </style>
> </head>
>
> <!------------------------------ BODY ---------------->
> <body>
> Text
> </body>
> </html>


> Matthias Pospiech
>


It is the hyphens in your comments that are the problem.
Remove the hyphens from inside all comments and your stylesheet will work.
For example
<!-- ************* HEAD ************* -->

Actually it is consecutive hyphens -- that are causing the problem, so
<!-- - - - - - BODY - - - - - -->
would be ok too.

Ste W


Beauregard T. Shagnasty 02-17-2004 05:28 PM

Re: CSS inlusion does not work
 
Quoth the raven named Matthias Pospiech:

> body {
> font-family: Verdana, Geneva, Lucida, Arial, Helvetica, sans-serif;
> font-size : 100%;


While we're examining your style sheet, consider this. Verdana is a
poor choice of font. I'd recommend using only Arial, Helvetica,
sans-serif;

http://www.xs4all.nl/~sbpoley/webmatters/verdana.html

Your choice of size at 100% is perfect, though.

--
-bts
-This space intentionally left blank.

Chet 02-17-2004 05:36 PM

Re: CSS inlusion does not work
 

"Matthias Pospiech" <matthias.pospiech@gmx.de> wrote in message
news:c0sj1s$j36$04$1@news.t-online.com...
| IF I try to set style settings inside a file they are not
recognised, only
| if they are directly inside to main html file.
| Here an example: The body settings for Font are only used if
inside the main
| file, not if inside the css file:
|
| <html>
| <!------------------------------ HEAD ---------------->
| <head>
| <title>Matthias Pospiech</title>
| <link href="main.css" rel="stylesheet" type="text/css">
| <style type="text/css">
| </style>
| </head>
|
| <!------------------------------ BODY ---------------->
| <body>
| Text
| </body>
| </html>
|
|
| // CSS - Style: Main Settings
|
| body {
| font-family: Verdana, Geneva, Lucida, Arial, Helvetica,
sans-serif;
| font-size : 100%;
| background-color : #FFFFFF;
| color : #000000;
| margin: 0px 0px 0px 0px;
| padding:0px;
| }
|
| This means that I cannot use style sheet files ! I tried in
Opera and
| Mozilla.
|
| Matthias Pospiech
|

In the head remove

<style type="text/css">
</style>

This may be overriding the external css since it is empty. Just a
thought...

hth
--
Chet
ng2.chet@NOcharterSPAM.net (remove NO.....SPAM)




All times are GMT. The time now is 12:21 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.