You are not logged in.

#1 2009-08-26 18:53:17

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

[Solved] HTML Page and css style file.

Hello.
I build HTML Page and want to add some style for it I have site and in it's source I got link to css file:

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

And in css file I got this:

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

And some me tweak's to change look , but when I go to my web page I see the same without css style.
Style.css and my page are in the same dir.
I'm using UZBL.
Thanks for help. smile

Last edited by SpeedVin (2009-08-27 07:38:20)


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#2 2009-08-26 19:37:00

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: [Solved] HTML Page and css style file.

You've posted the same code twice. For more about css tags take a look at: http://www.w3schools.com/css/default.asp

Offline

#3 2009-08-26 19:43:32

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: [Solved] HTML Page and css style file.

xd-0 wrote:

You've posted the same code twice. For more about css tags take a look at: http://www.w3schools.com/css/default.asp

I know thanks for the link but how to say to page that she have to use my style.css file?


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

#4 2009-08-26 19:57:52

XFire
Member
From: UK
Registered: 2008-05-11
Posts: 192

Re: [Solved] HTML Page and css style file.

Have you added the <div> tags to the HTML which correspond to the CSS tags?


There is a difference between bleeding [edge] and haemorrhaging. - Allan

Offline

#5 2009-08-26 20:19:04

Trent
Member
From: Baltimore, MD (US)
Registered: 2009-04-16
Posts: 990

Re: [Solved] HTML Page and css style file.

The <link> element is fine for a file named style.css in the same directory as the XHTML file that references it.  If the browser is ignoring the CSS entirely it could be a fatal syntax error in style.css; post it and we'll try to help out.

Offline

#6 2009-08-26 21:42:46

xd-0
Member
From: Sweden
Registered: 2007-11-02
Posts: 327
Website

Re: [Solved] HTML Page and css style file.

SpeedVin wrote:
xd-0 wrote:

You've posted the same code twice. For more about css tags take a look at: http://www.w3schools.com/css/default.asp

I know thanks for the link but how to say to page that she have to use my style.css file?

exactly like you have done. The code you've posted should beput inside the HEAD tag in the html document. The same code should not be used inside the style.css file.
Instead use proper css syntax, that are mentioned in the link I posted.  For example can your style.css can look like this

/* This is a comment in the css file. */
body {background:#ddd; color:#fff}
h1 {font-size:30px; color:#443F26;}

and the html file:

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

<body>
    <h1>Header nr1</h1>
    <p>some random text</p>
</body>
</html>

Offline

#7 2009-08-27 07:37:52

SpeedVin
Member
From: Poland
Registered: 2009-04-29
Posts: 955

Re: [Solved] HTML Page and css style file.

xd-0 wrote:
SpeedVin wrote:
xd-0 wrote:

You've posted the same code twice. For more about css tags take a look at: http://www.w3schools.com/css/default.asp

I know thanks for the link but how to say to page that she have to use my style.css file?

exactly like you have done. The code you've posted should beput inside the HEAD tag in the html document. The same code should not be used inside the style.css file.
Instead use proper css syntax, that are mentioned in the link I posted.  For example can your style.css can look like this

/* This is a comment in the css file. */
body {background:#ddd; color:#fff}
h1 {font-size:30px; color:#443F26;}

and the html file:

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

<body>
    <h1>Header nr1</h1>
    <p>some random text</p>
</body>
</html>

After applying this my page work with my css style file thank you all. smile


Shell Scripter | C/C++/Python/Java Coder | ZSH

Offline

Board footer

Powered by FluxBB