Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-21-2012, 09:59 PM   PM User | #1
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
external style sheet

I am unable to get my external style sheet to work.

I dragged the style sheet in Dreamweaver from the css folder to the <head> of the page.

<link rel="stylesheet" type="text/css" href="templates/template7/css/mytngstyle.css"/>

The css in the style sheet is:

#container
{
/* background-color: #edead9;*/

background-color: #FF0000;

margin-top: 100px;
margin: auto;
}

This is the code in the <body>

<body class="oneColFixCtr" >

<div id="container">
<div id="mainContent">
<table width="700" border="0" align = "center" >

I tried using the # and a "." and neither works. I want the CSS to connect to "container.


Thanks to all who help.

Last edited by rob86; 02-21-2012 at 11:10 PM..
rob86 is offline   Reply With Quote
Old 02-21-2012, 11:05 PM   PM User | #2
cercos
New Coder

 
Join Date: Feb 2012
Posts: 39
Thanks: 0
Thanked 9 Times in 9 Posts
cercos is an unknown quantity at this point
first change
background-color: ##FF0000;

to

background-color: #FF0000; you had two '#'

and to see if it's a problem with your location in the href put the code in between to <style></style> tags in the <head> directly in the page you want styled
cercos is offline   Reply With Quote
Users who have thanked cercos for this post:
rob86 (02-21-2012)
Old 02-21-2012, 11:11 PM   PM User | #3
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by cercos View Post
first change
background-color: ##FF0000;

to

background-color: #FF0000; you had two '#'

and to see if it's a problem with your location in the href put the code in between to <style></style> tags in the <head> directly in the page you want styled
OOPS!
That's not the problem. I made the correction above.
rob86 is offline   Reply With Quote
Old 02-22-2012, 04:49 AM   PM User | #4
cercos
New Coder

 
Join Date: Feb 2012
Posts: 39
Thanks: 0
Thanked 9 Times in 9 Posts
cercos is an unknown quantity at this point
I'm not getting what your actually having a problem with, what is the result you want and what's the result your getting?
cercos is offline   Reply With Quote
Old 02-22-2012, 01:31 PM   PM User | #5
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by cercos View Post
I'm not getting what your actually having a problem with, what is the result you want and what's the result your getting?
Read the original post. It's not working. According to Dreamweaver, It's correct, but it's not working.
rob86 is offline   Reply With Quote
Old 02-22-2012, 02:12 PM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,680
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Have you validated your CSS ?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 02-22-2012, 06:57 PM   PM User | #7
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post

No, I have never had a page pass yet. When I make the recommended corrections the page no longer works!!!
I can do html and beyond that very little.


Running the page through W3C says:

5 body p Parse Error p. style13 {font-size: x-small}
9 body p Parse Error } { padding-top: 60px; }
22 Parse Error [: #edead9; } div.maincontent background-color: #DCD5B9; } ]
rob86 is offline   Reply With Quote
Old 02-23-2012, 02:20 AM   PM User | #8
cercos
New Coder

 
Join Date: Feb 2012
Posts: 39
Thanks: 0
Thanked 9 Times in 9 Posts
cercos is an unknown quantity at this point
post your whole style sheet
cercos is offline   Reply With Quote
Users who have thanked cercos for this post:
rob86 (02-23-2012)
Old 02-23-2012, 02:47 AM   PM User | #9
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by cercos View Post
post your whole style sheet
/*your custom style goes in this file*/
/*if you're overriding style blocks from genstyle.css, you only need to include the attributes you're overriding, not the whole block*/

body
p. style13 {font-size: x-small}

{
padding-top: 60px;
}


#div.container

background-color: #edead9;

}
#div.maincontent

background-color: #DCD5B9;


The header states that this code over rides the default style sheet.
rob86 is offline   Reply With Quote
Old 02-23-2012, 03:09 AM   PM User | #10
cercos
New Coder

 
Join Date: Feb 2012
Posts: 39
Thanks: 0
Thanked 9 Times in 9 Posts
cercos is an unknown quantity at this point
Add whatever element you wanted to style where the YOUR_ELEMENT is. I fixed what I could see wrong try it out:

Code:
body,/*MISSING COMMA*/
p. style13 {font-size: x-small} 

YOUR_ELEMENT /*MISSING*/
{
padding-top: 60px;
}

#div.container
{ /*MISSING*/
background-color: #edead9;
}

#div.maincontent 
{/*MISSING*/
background-color: #DCD5B9;
}/*MISSING*/
cercos is offline   Reply With Quote
Users who have thanked cercos for this post:
rob86 (02-23-2012)
Old 02-23-2012, 04:29 PM   PM User | #11
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by cercos View Post
Add whatever element you wanted to style where the YOUR_ELEMENT is. I fixed what I could see wrong try it out:

Code:
body,/*MISSING COMMA*/
p. style13 {font-size: x-small} 

YOUR_ELEMENT /*MISSING*/
{
padding-top: 60px;
}

#div.container
{ /*MISSING*/
background-color: #edead9;
}


Sorry to say it didn't work.

#div.maincontent 
{/*MISSING*/
background-color: #DCD5B9;
}/*MISSING*/

Sorry to say it didn't work.
rob86 is offline   Reply With Quote
Old 02-24-2012, 01:41 AM   PM User | #12
Donkey
Regular Coder

 
Donkey's Avatar
 
Join Date: Sep 2003
Location: Blackfield UK
Posts: 309
Thanks: 1
Thanked 35 Times in 35 Posts
Donkey is an unknown quantity at this point
have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
Also; Check that the path
Code:
href="templates/template7/css/mytngstyle.css"/
is correct, and that the index file and other pages are in the root file.
__________________
" 90% of everything is crud" - Theodore Sturgeon
Filthy Beast - a 60's Rock Band
Donkey is offline   Reply With Quote
Users who have thanked Donkey for this post:
rob86 (02-24-2012)
Old 02-24-2012, 02:42 AM   PM User | #13
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by Donkey View Post
have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
Also; Check that the path
Code:
href="templates/template7/css/mytngstyle.css"/
is correct, and that the index file and other pages are in the root file.
I'm aware it needs to be on server and have done so.
Here is the code
<link rel="stylesheet" type="text/css" href="templates/template7/css/mytngstyle.css"/>

page.php/templates/template7/css/mytngstyle.css
rob86 is offline   Reply With Quote
Old 02-24-2012, 03:31 AM   PM User | #14
rob86
New Coder

 
Join Date: May 2007
Location: MI USA
Posts: 54
Thanks: 18
Thanked 1 Time in 1 Post
rob86 is an unknown quantity at this point
Quote:
Originally Posted by mddjfoclbyu View Post
have you uploaded your site to a server, or are you on a local web server? If you just have the files on your computer without using a web server (e.g. xamp) then the external CSS file won't work.
Also; Check that the path

They are on the server.
rob86 is offline   Reply With Quote
Old 02-24-2012, 03:36 AM   PM User | #15
skill3d
New Coder

 
Join Date: Oct 2011
Posts: 25
Thanks: 5
Thanked 1 Time in 1 Post
skill3d is an unknown quantity at this point
Make sure the css is in the correct folder and directory, and that you had no problems. Rename the file to ' style.css ' and use this code:

Code:
<link rel="stylesheet" type="text/css" href="templates/template7/css/style.css" />
Sometimes at the end of the code the
Code:
"/>
may need a space between the " and /
skill3d is offline   Reply With Quote
Users who have thanked skill3d for this post:
rob86 (02-24-2012)
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:13 PM.


Advertisement
Log in to turn off these ads.