FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

What is the difference between these?

 


exarkun
I was wondering in html there is a <body bg="XXX"> and in css there is something like background : url {XXX} and what exactly is the difference between that?
-TomJ-
As far as I know, there is only a structural difference.
When you define layout issues in the html file, it works for that document. But if you have a website that contains many pages, you'd have a hell of a job introducing a change in layout.
When you link a css file to each html file, you create one centralised place where you can modify the site's layout.

And because of the cascading styles, you can define a background color 'green' for the entire site in the css, and define a background color 'yellow' for one specific page in that page's html file.

But the end result of the two definitions is the same.
The syntax in css is different, but that is because css can describe a lot more than colours and fonts. Positioning, layering, relational tags, ...
niranvv
No difference!
Both are same!
Laughing

If you specify a Common Style Sheet ( CSS ),
then just edit the background : url {XXX} path!
it will alter all the background images associated with the whole project!!
( If using the same CSS file)
[Edited: Sorry, Its not Common Style Sheets! Its Cascading Style sheets
Thanks to: -TomJ- ]

But if you go for editing: <body bg="XXX"> ,
then u need to edit each and every pages of the project!

Its main thing behind using the CSS!

Wink


Last edited by niranvv on Fri Aug 25, 2006 2:40 pm; edited 3 times in total
-TomJ-
niranvv wrote:
If you specify a Common Style Sheet ( CSS ),


The exact name for css is cascading style sheet.
Named so because you can create various hierarchical levels of style definitions.
This allows making more specific styling details for specific circumstances.
Ranfaroth
exarkun wrote:
I was wondering in html there is a <body bg="XXX"> and in css there is something like background : url {XXX} and what exactly is the difference between that?
The first one is deprecated.
You must not style your element in HTML (for instance, a user agent which doesn't support color will spend useless time parsing those old HTML attributes)
exarkun
Thanks for the reply! I think I would just stick with the css one.
jabapyth
Ranfaroth wrote:
exarkun wrote:
I was wondering in html there is a <body bg="XXX"> and in css there is something like background : url {XXX} and what exactly is the difference between that?
The first one is deprecated.
You must not style your element in HTML (for instance, a user agent which doesn't support color will spend useless time parsing those old HTML attributes)

Yes. Its always better to stick with CSS: its easier to change, and its cleaner.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.