navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Style Sheet Layout

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> Cascading Style Sheets >> Style Sheet Layout
Page: [1]
 
Donkey

 

Posts: 3895
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
Style Sheet Layout - 7/5/2004 9:09:19   
I have never seen this mentioned in the forums before, but where you put your styles in a style sheet seems to make a big difference to whether they work properly or not (at least in Firefox and IE, Opera works wherever the styles are).

I found this out this weekend after finishing about 20 pages which I had checked in FF, Opera and IE and all looked perfect. Then suddenly big chunks of the page I was working on reverted to unformatted text except when viewed in Opera. When I checked back the same had happened on all the other pages. I couldn't understand it because I had checked the code was OK and valid, and within the same positioning div one block of text was fine and the next one unformatted.

After much tearing hair out and changing things then changing them back, it occurred to me that the only thing I had done differently before writing the last page was to add a few more styles to the style sheet. Although these styles were not used yet on the page they had the effect of lengthening the style sheet and pushing the text formatting style classes further away from the positioning div classes. (The style sheet is quite long.)

I moved the formatting style classes nearer to the positioning style classes and it all worked perfectly again.

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens
d a v e

 

Posts: 4147
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: Style Sheet Layout - 7/5/2004 10:21:56   
sounds bizarre - the only way it shoud make any difference is if the new styles had a direct influence on the existing ones and won out due to the cascade, or more likely contained errors thus resulting in no styles after that point.

_____________________________

David Prescott
Gekko web design

(in reply to Donkey)
Donkey

 

Posts: 3895
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: Style Sheet Layout - 7/5/2004 12:56:25   
Doh!
quote:

more likely contained errors thus resulting in no styles after that point
Spot on. I had a curly brace instead of a comma which knocked out everything past that point. What a stupid mistake to make! Thanks Dave.

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to d a v e)
d a v e

 

Posts: 4147
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: Style Sheet Layout - 7/5/2004 13:03:43   
huh i do that all the time, though in topstyle lite it shows when you do something like that. still have to notice it though!

_____________________________

David Prescott
Gekko web design

(in reply to Donkey)
jaybee

 

Posts: 14176
Joined: 10/7/2003
From: Berkshire, UK
Status: offline

 
RE: Style Sheet Layout - 7/5/2004 19:43:44   
quote:

What a stupid mistake to make!


:):):)

I loved reading all your reasoning at the top though! It must've taken you hours to come up with that one.

First rule of style sheet not working.......

check all ; and }

better still buy Topstyle or Rapid CSS or similar.

< Message edited by jaybee -- 7/5/2004 19:45:55 >


_____________________________

If it ain't broke..... fix it until it is.
:)

:)
GAWDS
Now where did I put that Doctype?

(in reply to d a v e)
Donkey

 

Posts: 3895
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: Style Sheet Layout - 7/5/2004 20:51:27   
quote:

It must've taken you hours to come up with that one.
Correct. At the time I thought it was a logical theory but it was based on a woefully bad misinterpretation of the evidence.

At least I've learnt something and I won't make that mistake again.:) Onwards and upwards!

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to jaybee)
markhawker

 

Posts: 511
Joined: 5/31/2004
From: Leeds, UK
Status: offline

 
RE: Style Sheet Layout - 7/6/2004 4:43:59   
Hi, glad you found the mistake Donkey! Just a question, how do you layout your CSS files? I'd recommend:

name {
   xxx: xxx;
   xxx: xxx;
   xxx: xxx;
}

I tend to use that when I'm coding too, especially with recursion and IF commands and FOR loops in PERL. Just because it gives you a better insight visually. I've seen some people putting their CSS all on one line, I guess it's personal preference. All on one line saves formatting etc. time, but is harder and takes longer to debug if things go wrong!

Mark


_____________________________

Mark Hawker
my business - http://www.thebubblejungle.com/
facebook - http://www.thebubblejungle.com/facebook/
web hosting - http://www.crucialp.com/

(in reply to Donkey)
d a v e

 

Posts: 4147
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: Style Sheet Layout - 7/6/2004 5:14:26   
I can recommend that way as well. topstyle et al do it like that.

_____________________________

David Prescott
Gekko web design

(in reply to markhawker)
Donkey

 

Posts: 3895
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: Style Sheet Layout - 7/6/2004 8:22:16   
That's the way I've always used. It's more logical and much easier to read.
My problem was that I didn't realise that a simple mistake would affect the rest of the sheet. I thought it would just affect the style containing the mistake, so I was looking in the wrong place. Still as I said before (famous last words) I won't make that mistake again.

I use notepad for writing css files and Matrixy2K for writing the code.

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to d a v e)
d a v e

 

Posts: 4147
Joined: 7/24/2002
From: England (but live in Finland now)
Status: offline

 
RE: Style Sheet Layout - 7/6/2004 10:36:44   
(i don't work for them) but topstyle lite will be sooooo much easier than using notepad
http://www.bradsoft.com/download/index.asp
and it's free (obviously the pro version is better) but the lite version is great

_____________________________

David Prescott
Gekko web design

(in reply to Donkey)
Donkey

 

Posts: 3895
Joined: 11/13/2001
From: Blackfield United Kingdom
Status: offline

 
RE: Style Sheet Layout - 7/6/2004 10:45:10   
Thanks, I'll take a look.

_____________________________

:)

I have a higher and grander standard of principle than George Washington. He could not lie; I can, but I won't.
Samuel Clemens

(in reply to d a v e)
why me!

 

Posts: 43
Joined: 4/30/2004
Status: offline

 
RE: Style Sheet Layout - 7/13/2004 15:43:23   
Are you sure you dont work for them!
I can agree that top style light is a very good free tool and its also very simple to use........ and when i get better i WILL upgrade.
Jim

(in reply to d a v e)
Page:   [1]

All Forums >> Web Development >> Cascading Style Sheets >> Style Sheet Layout
Page: [1]
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts