Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

HTML Forum


You are currently viewing our HTML Forum as a guest. Please register to participate.
Login



Post a Project »

Find a Professional HTML Freelancer!

Find a Freelancer to help you with your HTML projects

FREE Outsourcing eBook!

Reply
Page Specific CSS question
Old 08-05-2011, 12:32 AM Page Specific CSS question
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Hi There,

So I have a page that the client wants for it to have the price of an item's element in red.

All would be easy, but this .html page was created using PHP... would it be possible to just mod the .css so that it could be used only on this page and not the others??

Not sure how I could reference anything within the php document so that it could call in a new / seperate id, so this would be the path of least resistance if I could just change something on the css so that it would only work on this .html page...
Reckoner is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-05-2011, 03:55 AM Re: Page Specific CSS question
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Which way is the easiest depends a bit on how the site is structured. But evan if you don't know php you can probably open the file and locate where the price is printed. Perhaps something like
PHP Code:
echo '<div class="item">' $item->name ', price: ' $item->price '</div>'
Just wrap the price variable in a span tag with a class (i.e. <span class="item_price">). Then add a class definition to the css document,

.item_price { color: red; }
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 08-05-2011, 12:44 PM Re: Page Specific CSS question
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
That, or just use an inline style if you want only that page to have it, and not all of them.

However, if you want the red to just show up on one particular item, you'd need to add a separate if statement to decide whether or not to show the red. But, as you say, the page is a .html page. .html is different than .php. .html is static markup; what's there is what's there, so you can easily edit just that one file and have what you want.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 01:45 PM Re: Page Specific CSS question
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
So the thing is that the .html is dynamically created I think, I mean the page is here, but I can't find anything on the site where this .html page has been created if I could find it I could change the color of the prices easily...
http://www.talorton.com/c_View-All-S...ems-1-844.html

But I just don't know where to approach it, and the other areas of the site that use the a#productlist need to stay with the color that they are now. LIke this page.
http://www.talorton.com/c_View-All-S...ems-1-844.html

Any ideas?
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 02:03 PM Re: Page Specific CSS question
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
First of all, you shouldn't have multiple IDs of the same value. Looking in the source, every price has an ID of 'productlist'. Change those to class="productlist", and the CSS to .productlist, and you should be set.

As for changing the colour, here's what you do.

-Open talorton.css
-Look for the block of CSS that is this:
Code:
#menu ul ul a,
a#bottomcatlist, .account_head,
a#bottomcatlist:hover, 
a#productlist, 
a#productlist:hover, 
.navpage a,
.navpage a:hover, 
.highlightpage, .relatednav,
.navpageselected {
	color:#5C5C5C;
}
-Change the #5C5C5C to #ff0000.
-Change the #productlist to .productlist

Now open up the HTML pages that are using id=productlist.
-Change all id=productlist's to class="productlist".

You should be set
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 03:11 PM Re: Page Specific CSS question
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Thanks for the response, and I hear you... but changing that css value of #5C5C5C to #ff0000 would change the prices to red on ALL of the pages. I want to change it only on the one "sale items" page here:
http://www.talorton.com/c_View-All-S...ems-1-844.html

If I could find that page on the server and change the #productlist value to something else, that would be the easy fix, but the problem is that I've looked everywhere on the client's ftp for that html page and where it's created but I can't seem to locate it anywhere...
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 03:20 PM Re: Page Specific CSS question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It will be created by whatever catalogue/cart is in use on the site.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-05-2011, 03:46 PM Re: Page Specific CSS question
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
hmmm.. Yeah I would think so, but seriously there is not a single place on that ftp where the http://www.talorton.com/c_View-All-S...ems-1-844.html is located...
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 04:01 PM Re: Page Specific CSS question
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,380
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
There won't be, as it does not physically exist.

The page you are reading now has a .html extension but does NOT exist anywhere on a hard drive.

It is simply a stream of binary data created by a series of scripts and a database that is then output to the user agent on request.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-05-2011, 04:48 PM Re: Page Specific CSS question
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
To extend on Chris' answer:

Take a look at the .htaccess file (it's hidden) to see what's really going on. If you can't understand it, post it here.
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 05:47 PM Re: Page Specific CSS question
Extreme Talker

Posts: 246
Name: Patric
Trades: 0
Thanks for sticking with me on this guys. Here's the htaccess file:

Quote:
AddType text/x-component .htc
RewriteEngine on
RewriteBase /

#RewriteCond %{HTTP_HOST} !^www.amenwardyaspen.com [nc]
#RewriteRule (.*) http://www.amenwardyaspen.com/$1 [R=301,L]

RewriteRule .html ./index.php
RewriteRule sitemap.xml ./index.php?sitemap=1
#RewriteRule sitemap.html ./index.php?show_tree=3

php_flag display_errors on
php_value error_reporting 7

php_flag magic_quotes_gpc off

AddDefaultCharset On

<Files _testimage.jpg>
ForceType application/x-httpd-php
</Files>
<Files thumb_create.jpg>
ForceType application/x-httpd-php
</Files>

<Files thumb_create2.jpg>
ForceType application/x-httpd-php
</Files>

<Files thumb_create3.jpg>
ForceType application/x-httpd-php
</Files>

<Files thumb_create4.jpg>
ForceType application/x-httpd-php
</Files>
Reckoner is offline
Reply With Quote
View Public Profile
 
Old 08-05-2011, 07:15 PM Re: Page Specific CSS question
Physicsguy's Avatar
404 - Title not found

Posts: 919
Name: Scott Kaye
Location: Ontario
Trades: 0
Hmm. I don't see anything that could be making HTML run as PHP, so that option is X'd out.

This is beyond me, I'm sorry. You might want to ask the server administrator, or look through the README's of any site plugins you're using. I'm sorry I can't be of any assistance here!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Old 08-06-2011, 08:00 PM Re: Page Specific CSS question
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
All of the HTML "pages" are being generated by index.php (which is in the root directory). At some point the code is examining the requested URI to determine what to generate - you have to determine an appropriate place to do a conditional statement "IF this is the sale page DO use sales CSS ELSE use normal css". (I know, two CSS files but it's easier.)

However, there are two complications. First, how is the name of the sales page determined (is it always c_View-All-Sale-Items-1-844.html ?) If not, this is either a one off fix or you need to be cleverer on the conditional - getting a bit messy already. Secondly, you won't be able to carry the style change forward to individual product pages.

Bottom line: tell the client that there is significant coding required and the price (and risk of errors) has gone up a lot.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Page Specific CSS question
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46204 seconds with 12 queries