473,378 Members | 1,218 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,378 software developers and data experts.

Must I put my CSS declarations inside the HEAD tag?

mikek12004
200 100+
Normally most of my CSS decleration are inside the HEAD tag but since I use the same page to show many different contents (based on a $_GET PHP variable and the help of the include() ) it happens some times to add a CSS style say
Expand|Select|Wrap|Line Numbers
  1. <style type='text/css'>
  2. .style1{
  3.   color:#FF0000;
  4. }
  5. </style>
  6. inside the body and works just fine so  is it ok? 
  7. PS the same thing is happening also with my javascript declaration for anyone who knows I would like their opinioin in this also
  8.  
Aug 7 '09 #1
9 3120
drhowarddrfine
7,435 Expert 4TB
No. .
Aug 7 '09 #2
mikek12004
200 100+
True I have tested it noumerus times both with JS and CSS and I cannot see the difference however why 100% of the books and tutorials insist on on puting these declarations inside the HEAD?
Aug 11 '09 #3
Dormilich
8,658 Expert Mod 8TB
@mikek12004
because all the styles are available for rendering before any of the body will be processed. if you put the styles somewhere in the body, the styles are available after they were processed, but there may be elements that have been already processed and match the CSS rules and therefore have to be processed again.
Aug 11 '09 #4
mikek12004
200 100+
In the case I want the styles to affect only tags that come after them all are ok right?
Aug 11 '09 #5
Dormilich
8,658 Expert Mod 8TB
I guess, though I’m not a browser specialist.
Aug 11 '09 #6
mikek12004
200 100+
Vielen Dank Dormilich, I will dig a bit more myself
P.S. Like your avatar remindes me samurai deeper kyo
Aug 11 '09 #7
Dormilich
8,658 Expert Mod 8TB
@mikek12004
it’s Toph Bei Fong, a really cool character
Aug 11 '09 #8
mikek12004
200 100+
Well since you got into the trouble of telling me yours the least I could do is upload mine (Kenshin Himura)
Aug 12 '09 #9
Dormilich
8,658 Expert Mod 8TB
@mikek12004
ah, good ole hitokiri kenshin
Aug 12 '09 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Michael Tobis | last post by:
Summary of my understanding of a recent interesting thread: General usage has "declaration" meaning "statement which does not generate executable bytecode but merely affects the compiler". My...
0
by: Morten Gulbrandsen | last post by:
mysql> USE company; Database changed mysql> mysql> DROP TABLE IF EXISTS EMPLOYEE; -------------- DROP TABLE IF EXISTS EMPLOYEE -------------- Query OK, 0 rows affected (0.00 sec)
5
by: Neil Zanella | last post by:
Hello, Unlike in pre-C99 versions of C where variables can only be defined at the beginning of blocks, C99 allows variables to be defined in arbitrary places inside blocks. However, gcc 3.2.2...
9
by: AnandRaj | last post by:
Hi guys, I have a few doubts in C. 1. Why static declartions are not allowed inside structs? eg struct a { static int i; }; Throws an error ..
7
by: Tom wilson | last post by:
I'm trying to create dynamic controls in ASP.Net. It's driving me nuts. I keep getting the error: Control '16' of type 'RadioButton' must be placed inside a form tag with runat=server. Dim...
10
by: Xiaoshen Li | last post by:
Dear All, I am confused with prototypes in C. I saw the following code in a C book: void init_array_1(int data) { /* some code here */ }
3
by: Till Crueger | last post by:
Hi, I am trying to implement a tree in C and I have the folowing code: struct inner { struct node *left; struct node *right; }; struct leaf {
3
by: steve | last post by:
Hi all, I want to be able to hirearchally define event delegate (declarations) WITHIN interfaces. Unfortunatelly C# 1 doesn't appear to support it. How does the following look as a...
4
by: Paulo Matos | last post by:
Hi all, I'm trying to work out a parser for function declarations but it turns out that it is harder than I initially thought. I'm looking at 3rd Ed of Stroustrup, page 808. I'm trying to parse...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.