Introducing An External Stylesheet

Any problem with HTML can be discussed here.
Locked
Flickorian
Posts: 53
Joined: Tue Apr 24, 2007 11:01 pm

Introducing An External Stylesheet

Post by Flickorian »

When coding my own site, for organizational purposes, I prefer to use an external stylesheet.
External Stylesheet: A cascading style sheets (CSS) style that is written in an external **** and can be referenced by multiple ****.
(source: http://webdesign.about.com/od/css/g/bldefextstyle.htm}

So, basically you take your stylesheet syntax, such as

Code: Select all

body {background:#404040 url('background-url.com') fixed;)
and stick it in a seperate **** that you would name something like "mystyle.css". It MUST have a .css suffix or else it will not read properly therefore, be useless.

Once you've got your stylesheet created, saved and uploaded to the server of your choice, you simply insert a code inter the <head> </head> section of your HTML page that would look like:

Code: Select all

<link rel="stylesheet" type="text/css" href="mystyle.css">
This will basically prevent you from having to add all of that wild looking stylesheet crap to you HTML page. For me, it makes it easier to sort through when I need to edit. Also keeps everything looking nice and neat.


webdesigner
Posts: 19
Joined: Fri Jun 08, 2007 6:14 am
Contact:

Post by webdesigner »

IMHO, from the SEO point of view, its a good thing to use external CSS instead of placing the dozen lines of CSS code inside the html file. Search Engine Bots doesnt interested with CSS, they are lookin for the site content, keyword composition and your html tag used.


**** wrote:When coding my own site, for organizational purposes, I prefer to use an external stylesheet.
anish
Posts: 353
Joined: Fri Apr 27, 2007 12:34 pm
Contact:

Post by anish »

cool introduction for external css.
sakhan
Posts: 217
Joined: Sat May 26, 2007 6:02 am

Post by sakhan »

seo experts recommend external stylesheets over inside your webpage also it make your work load less and auto
web_master
Posts: 202
Joined: Thu Apr 19, 2007 6:11 pm

Post by web_master »

You can also use the following to Import a external css stylesheet.

Code: Select all

<style>
@import URL (http://www.yoursite.com/styles.css);
... continue styles
</style>
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

what is a difference between:

Code: Select all

<link rel="stylesheet" type="text/css" href=" [CSS_URL] ">
and

Code: Select all

@import URL ( [CSS_URL] );
???
Image
Flipper3
Posts: 353
Joined: Tue Feb 28, 2006 12:34 am

Post by Flipper3 »

Using external stylesheets is good when making templates because you can just change the stylesheet. :)
Gyanu
Posts: 338
Joined: Mon Jul 30, 2007 2:03 pm
Contact:

Post by Gyanu »

do u know how to keep background through css style?
Image
Lixas
Posts: 750
Joined: Wed Feb 16, 2005 4:21 pm

Post by Lixas »

google: css background :@

-=LOCKED=-
Image
Locked