XHTML/CSS Not Displaying Correctly

General ShopSite user discussion

XHTML/CSS Not Displaying Correctly

Postby ingredients » Tue Oct 30, 2007 5:39 pm

Hi,

I'm having trouble getting XHTML to display correctly with my CSS Include file. The text and image display when uploaded and applied to a test page in SS, but the formatting is only applying itself to the <body>, and is not recognizing syle added to #container and #header. Here's the XHTML for this section:

[-- DEFINE PAGE --]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/transitional.dtd">
<html>
<head>
<title>[-- PAGE.Name --]</title>

<style type="text/css">
[-- INCLUDE ccbc_main_styles.css PROCESS --]
</style>

<body>

[-- HEADER --]

<div id="container">

<div id="header">

<div id="logo"><img src="/media/img/ccbc_logo.png" alt="logo"></div>
Header Test
</div>
</div>

The corresponding CSS file is:

body {
background-color: #0C028E;
background-image: url(../img/body_bg.png);
background-repeat: no-repeat;
color: #0C028E;
font-family: "Century Gothic", Georgia, Arial, Verdana, sans-serif;
font-size: .8em;
margin:0em;
padding: 0em; }

#container {
width:800px;
margin:auto;
text-align:left;}

#header {
float:left;
width:90%;
background:#FFFFFF;
font-size:93%;
line-height:normal;
}

Any help would be greatly appreciated!

Heather
ingredients
 
Posts: 5
Joined: Tue Oct 30, 2007 5:23 pm

CSS/XHTML Not Displaying

Postby BFChris » Wed Oct 31, 2007 8:13 am

A few questions:

1) Is your Include Working properly? (ie. when you view the source of the generated page, does the CSS appear in the proper location in place of the [INCLUDE ... PROCESS] tag?)

2) You also don't appear to have a close to your <head> tag.

3) You are referring to XHTML but your Doctype declaration says HTML 4.01.

4) What styles aren't being recognized (width and layout type items, color and text format type items, or all?)
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Postby ingredients » Wed Oct 31, 2007 8:36 am

Hi Chris -

Thanks for you reply. Here are the answers to your questions:

1) Is your Include Working properly? (ie. when you view the source of the generated page, does the CSS appear in the proper location in place of the [INCLUDE ... PROCESS] tag?)


The include works only for the <body> section. The background image appears and the font works correctly.


2) You also don't appear to have a close to your <head> tag.


This is further down in the code; I didn't paste it in the message, but it is there.

3) You are referring to XHTML but your Doctype declaration says HTML 4.01.


Good catch, thank you. I copied and pasted from the wrong file! I have changed it to: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">, but it has not fixed the CSS problem.

4) What styles aren't being recognized (width and layout type items, color and text format type items, or all?)


Nothing below the styles for <body> appear to be recognized. The logo image appears top left, as well as the text "Header Test," but no style is applied other than the <body> default styles.

Let me know what other questions you have - I'm stumped!

Heather[/quote]
ingredients
 
Posts: 5
Joined: Tue Oct 30, 2007 5:23 pm

CSS/XHTML Not Displaying

Postby BFChris » Wed Oct 31, 2007 9:04 am

Can you post a link to the page either here or via Private message?
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Postby BFChris » Wed Oct 31, 2007 9:06 am

ingredients wrote:
2) You also don't appear to have a close to your <head> tag.


This is further down in the code; I didn't paste it in the message, but it is there.



How much further down? I mean your "head" TAG, not your Header DIV. The Closing "head" tag should come BEFORE the opening of the BODY tag.
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Re: XHTML/CSS Not Working Properly

Postby BFChris » Thu Nov 01, 2007 9:16 am

Just an FYI/Update:

Via private message exchange, I helped Heather to determine the cause of this problem.

It seems that the "PROCESS" function being performed by Shopsite on the CSS file was stripping the # sign from the style declaration for her DIV IDs.

We resolved the issue by removing the "Process" parameter from the Include, which worked fine since she had no Shopsite tags in her CSS file.

Shopsite Folks: Are you aware of this and is there a solution if one needs to use the Include Process function?
~~Barefoot Chris
--------------------------------
Barefoot Chris Web Design
www.barefootchris.net
--------------------------------
BFChris
 
Posts: 322
Joined: Mon Oct 09, 2006 3:28 pm
Location: PA

Postby loren_d_c » Thu Nov 01, 2007 9:48 am

Chris,

In any file being processed for ShopSite tags a line that has a # as the first characters on the line will be treated as a comment and that entire line will be stripped from the HTML output by that template file. Again, this is only if the # is the first character, if you put a space character before the # so that the space is the first character on the line, then the line will not be treated as a template comment.

-Loren
loren_d_c
 
Posts: 2572
Joined: Fri Aug 04, 2006 12:02 pm
Location: Anywhere


Return to User Forum

Who is online

Users browsing this forum: No registered users and 111 guests

cron