Go to Post You do realize that you all started jumping to conclusions without asking first which JVN he was talking about. - Jay H 237 [more]
Home
Go Back   Chief Delphi > Technical > IT / Communications > Website Design/Showcase
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 02-15-2011, 08:23 PM
Red One's Avatar
Red One Red One is offline
missed the site deadline.
AKA: Pete Almanza
FRC #2950 (The Devastators)
Team Role: Webmaster
 
Join Date: Jan 2010
Rookie Year: 2009
Location: Waco
Posts: 17
Red One is an unknown quantity at this point
Style code trouble!

I have two pages that I recently validated through W3C and had the validator clean up the errors for me. Those two pages were uploaded again to the main site but the background color became black instead of the original color of purple. I tried inserting just regular bg color code but that didn't work.

<style type="text/css">
/*<![CDATA[*/
body.c8 {background-color:#37007b}
p.c7 {margin-left:-325px;}
div.c6 {margin-top:-50px; margin-left:-50px;}
img.c5 {margin-top:-301px; margin-right:15px;}
img.c4 {margin-left:-324px;}
p.c3 {float: right; width: 50%; text-align: center;}
p.c2 {float: left; width: 50%; text-align: center;}
img.c1 {margin-right:330px}
/*]]>*/
</style>

This is the style type that contains the error. Note that the bg color is set to the custom value. This is the other style for the other page I happened to correct( I attempted copy and paste but had no luck either):

<style type="text/css">
/*<![CDATA[*/
body {background-color:#37007b}
p.c5 {margin-left:-325px;}
div.c4 {margin-top:-50px; margin-left:-50px;}
div.c3 {text-align: center}
p.c2 {font-size: 144%}
img.c1 {margin-right:330px}
/*]]>*/
</style>

If anyone has an idea of what could be wrong, I would greatly apprecitate the help!
__________________


Sometimes we crash and burn. It's better to do it in private.

-Dean Kamen
  #2   Spotlight this post!  
Unread 02-15-2011, 08:51 PM
Dan Zollman's Avatar
Dan Zollman Dan Zollman is offline
7
FRC #1712 (Dawgma)
Team Role: Alumni
 
Join Date: May 2005
Rookie Year: 2005
Location: Ardmore, PA
Posts: 392
Dan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond repute
Re: Style code trouble!

Could you clarify which block of code is working and which isn't?

Try comparing the selectors in each blog. For example, the first one has styles for

Code:
body.c8
which means they will apply to the body tag only if you have

Code:
<body class="c8">
in the HTML. In the second block, the selector is just "body", meaning that it will apply
to the body tag regardless of its classes.

If you compare the selectors as well as the classes used in the HTML itself, that might explain the results you're getting.
__________________
Product design student at Rensselaer
Web designer/consultant
FIRST alum, Dawgma 1712

dan.zollman - at - gmail.com
  #3   Spotlight this post!  
Unread 02-16-2011, 09:18 PM
perlgerl perlgerl is offline
Michelle
FRC #0781 (Kinetic Knights)
Team Role: Mentor
 
Join Date: May 2010
Rookie Year: 2010
Location: Kincardine
Posts: 38
perlgerl is just really niceperlgerl is just really niceperlgerl is just really niceperlgerl is just really nice
Re: Style code trouble!

Did you miss the semi-colon? eg

body.c8 {background-color:#37007b;}
  #4   Spotlight this post!  
Unread 02-16-2011, 09:38 PM
Cecil's Avatar
Cecil Cecil is offline
Registered User
AKA: Alex Hummel
FRC #2010 (Lightning Bots)
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Champion
Posts: 343
Cecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to beholdCecil is a splendid one to behold
Re: Style code trouble!

Quote:
Originally Posted by perlgerl View Post
Did you miss the semi-colon? eg

body.c8 {background-color:#37007b;}
Normally, you don't need the semicolon for the last one. You only need it if you are separating multiple styles for the same thing.
__________________
I'm right 90% of the time, so why worry about the other 3%?
  #5   Spotlight this post!  
Unread 02-16-2011, 09:50 PM
aechmtwash11 aechmtwash11 is offline
Registered User
FRC #2783
 
Join Date: Feb 2010
Location: Kentucky
Posts: 84
aechmtwash11 is an unknown quantity at this point
Re: Style code trouble!

i would say add semi colons to everything and remove the /*<![CDATA[*/ & /*]]>*/ (What is that stuff even for?)
__________________
  #6   Spotlight this post!  
Unread 02-17-2011, 01:20 AM
Dan Zollman's Avatar
Dan Zollman Dan Zollman is offline
7
FRC #1712 (Dawgma)
Team Role: Alumni
 
Join Date: May 2005
Rookie Year: 2005
Location: Ardmore, PA
Posts: 392
Dan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond reputeDan Zollman has a reputation beyond repute
Re: Style code trouble!

Quote:
Originally Posted by aechmtwash11 View Post
i would say add semi colons to everything and remove the /*<![CDATA[*/ & /*]]>*/ (What is that stuff even for?)
Yup, the CDATA stuff is not needed--but in this case, both lines are /* commented out */ so they won't impact the CSS.

And Cecil is correct; the last semicolon in each block is optional.
__________________
Product design student at Rensselaer
Web designer/consultant
FIRST alum, Dawgma 1712

dan.zollman - at - gmail.com
Closed Thread


Thread Tools
Display Modes 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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:12 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi