Home arrow Coding arrow CSS - Inline, Internal and External Style Sheets.

CSS - Inline, Internal and External Style Sheets.

PDF  | Print |  E-mail
(0 votes)
Written by ultrabeast   
Wednesday, 19 March 2008
When one does programming, one wants fast access to the function definitions, attribute descriptions, all the available options, info, etc. Trying to code something without the documentation is like trying to write a C++ or MFC program without the MSDN library. In short, that means impossible.

Likewise, don't CuSS CSS when you need to tweak your template, for complete online documentation is handily available at w3schools.com - for every web element that you can tweak, there are handy Try-It! pages for you to tweak and update to see the effects of your changes on-the-spot.

Today, we're talking about CSS inline style definition, internal and external stylesheets.
inline: <tag style="..."> within the tag itself
internal: <style> ... </style> between the <head> tags
external: most commonly seen, defines everything in a file separate from the HTML file, and can be reused by different HTML files.

http://www.w3schools.com/css/css_howto.asp
for the quickest reference.

Example of Inline CSS
  1. <p style="color: sienna; margin-left: 20px">
  2. This is a paragraph
  3. </p>

'Internal' style sheet
  1. <head>
  2. <style type="text/css">
  3. <!--
  4. hr {color: sienna}
  5. p {margin-left: 20px}
  6. body {background-image: url("images/back40.gif")}
  7. -->
  8. </style>
  9. </head>

Linking a HTML file to an External style sheet
  1. <link rel="stylesheet" type="text/css"
  2. href="mystyle.css" />
  3. </head>

And there you have it - the quickest reference to CSS.

I also strongly recommend this article at
http://www.communitymx.com/content/article.cfm?page=2&cid=FAF76
namely: CSS: Getting Into Good Coding Habits.

Page 2 talks about removing the browser's default formatting settings,
Page 3 talks about making your pages standards compliant and all-browser friendly,
Page 4 talks about specifying your id and class selectors,
Page 5 talks about specifying our own custom settings to override the browser's defaults that we have just cleared off in Page 2.

So there we have it, quick reference whenever questions about these aspects pop up in one's mind...
Comments
Add New Search RSS
Write comment
Name:
Email:
 
Website:
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

 
< Prev   Next >
Advertisement

Latest Comments!

RSS Syndication


Save to FireFox Live Bookmarks:
feed-icon-12x12-orange.gif
View Feed XML

Search I, UltraBeast!

ShoutMix CB


Say No to Internet Explorer!

- This site will give an "Operation Aborted" error with IE whenever there are photo galleries on the page.

- MOZILLA FIREFOX is the recommended browser.

- Let me know if there are problems with Opera, Safari, etc.
Thanks ~

Problems Registering?

If you have problems getting your activation email, fret not:
  • Simply log in below using your Username and Password to get that mail sent again to you.
  • Check your bulk/junk/trash mail.
  • Rinse and repeat as many times as necessary.
Should all else fail - I can be contacted at
Email webmaster

Login





Live Traffic Feed

Who's Online

No Users Online
© 2008 Interview With The UltraBeast
Joomla! is Free Software released under the GNU/GPL License.