473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Newbie - when is the CSS applied?

Hello, I'm new to CSS and I see lots of examples where Javascript is
used to apply styles to elements on page load - unobtrusive javascript
- so I assume the CSS must be applied last before the page is actually
displayed to the user. Am I correct? If not, when is the CSS
actually applied? And is there any tools that are used to debug CSS?

TIA
G
May 31 '08 #1
2 1886
GiJeet wrote:
Hello, I'm new to CSS and I see lots of examples where Javascript is
used to apply styles to elements on page load - unobtrusive javascript
- so I assume the CSS must be applied last before the page is actually
displayed to the user. Am I correct? If not, when is the CSS
actually applied? And is there any tools that are used to debug CSS?
CSS is typically applied at the time of page rendering, which (in modern
browsers), starts as the page is downloaded.

<technical>
Steps to display a web page:
1. Fetch the page and start downloading.
2. Hit the body and actual content. Start downloading external pages
(from style and script tags) as soon as you see those tags.
3. Start rendering the content currently downloaded as the page is
downloading.
4. If an external style page is loaded, reflow the current page to apply
those styles.
5. If a script tag without defer is hit, execute the script inside.
6. As more content is downloaded, reflow the page with the additional
content.
7. Once page is finished loading, fire the onload tags of the body and
execute the deferred scripts. Any dynamic modifications to the DOM or to
the styles cause a reflow.
</technical>

You should be able to see this effect if you load a moderate-sized
complex page and throttle your connection down to a few Kb/s.

As for tools to debug CSS, Firebug in Firefox and Dragonfly in Opera
should both be adequate.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Jun 1 '08 #2
On Jun 1, 9:36 am, Joshua Cranmer <Pidgeo...@verizon.invalidwrote:
<technical>
Steps to display a web page:
1. Fetch the page and start downloading.
2. Hit the body and actual content. Start downloading external pages
(from style and script tags) as soon as you see those tags.
3. Start rendering the content currently downloaded as the page is
downloading.
4. If an external style page is loaded, reflow the current page to apply
those styles.
5. If a script tag without defer is hit, execute the script inside.
6. As more content is downloaded, reflow the page with the additional
content.
7. Once page is finished loading, fire the onload tags of the body and
execute the deferred scripts. Any dynamic modifications to the DOM or to
the styles cause a reflow.
</technical>

You should be able to see this effect if you load a moderate-sized
complex page and throttle your connection down to a few Kb/s.

As for tools to debug CSS, Firebug in Firefox and Dragonfly in Opera
should both be adequate.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
Thanks!
Jun 1 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Frobinrobin | last post by:
Hi all, I have this irritating problem. I cannot use tables and I need to format text in columns. I decided that DIV would serve the purpose and set about learning a few properties for them....
6
by: Francois Grieu | last post by:
Hello, I'm asking myself all kind of questions on allocating an array of struct with proper alignment. Is the following code oorrect ? I'm most interested by the statement t =...
46
by: Carlo Milanesi | last post by:
Hello, traditionally, in C++, dynamically allocated memory has been managed explicitly by calling "delete" in the application code. Now, in addition to the standard library strings, containers,...
2
by: GiJeet | last post by:
Hello, I'm new to CSS and I see lots of examples where Javascript is used to apply styles to elements on page load - unobtrusive javascript - so I assume the CSS must be applied last before the...
6
by: HightowerC | last post by:
Wow...reading this group is a little overwhelming. Hope I'm posting to the right place. I'm a newbie when it comes to VB and .NET, but my company is making a move in that direction. Just looking...
5
by: SharkD | last post by:
Hi! I'm a total newbie when it comes to ASP (or any type of server-side programming). I want to start a project that does the following: 1. query Wikipedia for information regarding...
4
by: djminus1 | last post by:
I am attempting to build a RIA using Flex3, PHP, and MySQL. I am really a newbie when it comes to MySQL. I need some help in desiging my database for this application. My application will allow...
1
by: Larsr | last post by:
Hi, in building a navigation system, I would like to use a system where I have, say, four links which naturally are different pages. Initially, all links are, say, blue. When clicking on the first...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.