Solved

Stylesheets with php includes

Posted on 2011-02-17
6
316 Views
Last Modified: 2012-05-11
I have created a page that I will use php includes to add to another page.  I need the stylesheet for the "includes" page to override the stylesheet for the page that it is going on.  

For the most part, the pages are on the same server just in different folders where different domain names point to those folders.  

I have tried
<style type="text/css">
@import url("http://www.brightideaswebdesign.com/includes/news/newsstyle.css");
</style>

and it works on Firefox and Safari but not on Chrome.  I have a Mac so I haven't checked on IE yet.

0
Comment
Question by:brightsusan
  • 3
  • 3
6 Comments
 
LVL 8

Expert Comment

by:imantas
ID: 34922257
Does the Chrome ignore whole CSS file or just some of the styles are overridden? Link to the page where the problem appears would be appreciated.
0
 

Author Comment

by:brightsusan
ID: 34922546
It seems to ignore all of it.

http://www.trainwithcasie.com

about 1/2 way down on the right side (under the "Movin On Up' graphic) there is a link that says "Click Here" to view the Mary Kay Career Path At a Glance)  The link is supposed to be a tan color and it is in other browsers but not in chrome.
0
 
LVL 8

Accepted Solution

by:
imantas earned 500 total points
ID: 34922640
I think you have errors in your stylesheet.

First of all
.dark a:link{
	color: #CCC;	
}

Open in new window

doesn't make sense as it is overriden by
table #different a:link{
	text-decoration: underline;	
	color: #000;
}

Open in new window

I think you meant to define '.dark a:link' styles after the 'table #different a:link' as the last one declared is applied to the element.


Secondly, I think you meant "table#different" (table with ID = 'different') instead of "table #different" (all descendants of any table in the page with ID = 'different').

Thirdly, I don't get the idea what does this supposed to mean:
...
<tr style="a:link">
...

Open in new window

0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

Author Comment

by:brightsusan
ID: 34926996
The first and last of those were just things I was trying.

The middle is actually for all links inside that table.  The reason for that is that the pages that I will be "including" this on have different styles for links and I want this table to have the same link color across the board without taking on each style of each site.

I want the table links to be black and underlined but then this certain link I need to be #ccc since it is in a dark brown background.

What would be the best way to do that?
0
 
LVL 8

Expert Comment

by:imantas
ID: 34930167
I see that you've changed the stylesheet.

You have a line:
a.brown:link {color: #ccc; text-decoration: none; }

Open in new window


Change it to:
a.brown:link {
  color: #ccc !important;
  text-decoration: none;
}

Open in new window


That might help
0
 

Author Comment

by:brightsusan
ID: 34930220
Didn't work.  It still works on Safari and Firefox but not Chrome
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to Popup 37 82
jQuery Time Off Event 20 42
Install bootstrap locally using Angular CLI 2 25
Phone Dialer 5 37
This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now