include() seems to mess up my css!

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

include() seems to mess up my css!

Post by Skittlewidth »

I've got an access control file which I include on every page on a site in order to check whether the user is logged in, or has the correct security privileges to view the page they are on.

The pages it is included on used to display fine even when I included the access.php file, but I must have done something yesterday because now if the file is included all the text displays one size larger in IE than is defined in the .css file. It looks as if some one has set the browser text size to large but I've checked and its set to the default medium as before.
As soon as I remove the include() file it displays fine again. Note this hasn't affected Netscape 7.

I've stripped all the html/css out of the include file, but for the form and the "login failed messages", but its still causing the same prob if I include it. I haven't posted any code for now because theres quite a bit of it.

The file is included at the very top of each page before any browser output. I've read through most of the css issues on the forum in search of a reason for this problem but had no luck so far.

Any suggestions anyone? It's driving me crazy! :cry:
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

The only time i've had this problem (all the text looks too big) is when i've put badly formed html somewhere, like putting </ddiv> instead of </div> etc. I'd check over the included files code and just make sure it's all valid so you can rule that out as an issue.
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

Hmm I've copied the code out into another document and removed all the html as opposed to commenting it out as before, and the problem has gone away.

Now I'm putting the HTML back step by step in an attempt to understand what was doing it. The only thing Dreamweaver warned me about when I got it to validate the code (never used this feature before so I don't know how good it is) was that I was using XML style /> at the end of my <input> fields which isn't valid in HTML. Simply removing these didn't do the trick however.

I'll let you know what the problem was if I ever find out myself! Thanks
User avatar
Skittlewidth
Forum Contributor
Posts: 389
Joined: Wed Nov 06, 2002 9:18 am
Location: Kent, UK

Post by Skittlewidth »

Thats so wierd! So far I've recreated the file EXACTLY as it was before and the error has stopped happening!
Lets just see what happens when I try and format the text on the include file.... :?

[5 minutes later...]
Yep its definately to do with trying to apply css styles to the html on the include file. I guess I'll just do it with <font> tags instead just for this one... :(

[15 mins later...]
Actually it was to do with coding anything outside any of the php if statements since this would be written to the host page regardless of whether it needed to be displayed or not...silly me... :oops: I guess it was trying to attach the style sheet twice
Post Reply