School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!

Welcome to Dream.In.Code
Become an Expert!

Join 300,455 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,591 people online right now. Registration is fast and FREE... Join Now!




Functionality of Style Sheets

 

Functionality of Style Sheets

Torres58

5 Jul, 2008 - 01:23 AM
Post #1

New D.I.C Head
*

Joined: 4 Jul, 2008
Posts: 1



Thanked: 2 times
My Contributions
There are 3 basic ways to add the functionality of Style Sheets:

1. Inline - Creating the elements for each HTML Tag. This will allow the same HTML Tag to have different styles on the same page.
2. Embedding - Creating the elements on the page itself that will affect every occurrence of an HTML Tag.
3. Linking - Creating one page that defines the elements and include in the pages that you want to affect.

For Website design services using Embedding or Linking is recommended.. The Linking Style is used when you want to use the same style on multiple pages, you can then use Embedding and/or Inline on specific pages that don't fit the design style of the Linking Sheet. <H4>Precedence and inheritance</H4> as the term Cascading Style Sheets implies, more than one style sheet can be used on the same document, with different levels of importance. Generally styles from different style sheets merge together (cascade) into a virtual style.

However, if you define conflicting styles for the same HTML element, the innermost definition--the one closest to the individual tag-wins the precedence Style Sheets follow is Inline, Embedding, and then Linking. Inline Style takes precedence over Embedding Style, which takes precedence over Linking Style. There is a fourth style sheet which is set not by the document author but by the reader and that is the browser default. Taking this style sheet into consideration the order of precedence is: Inline Style (inside HTML element), Embedding Style Sheet (inside the <head> tag), External Style Sheet and Browser default. So, an inline style (inside an HTML element) has the highest priority, which means that it will override every style declared inside the <head> tag, in an external style sheet, and in a browser (a default value).


User is offlineProfile CardPM
+Quote Post


gabehabe

RE: Functionality Of Style Sheets

5 Jul, 2008 - 08:02 AM
Post #2

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,829



Thanked: 175 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
Welcome to </dream.in.code> Torres58 smile.gif

I'm gonna go ahead and pin this for a while, I think a few people may find it pretty useful icon_up.gif
User is online!Profile CardPM
+Quote Post

Bort

RE: Functionality Of Style Sheets

21 Aug, 2008 - 06:38 AM
Post #3

VBort.NET
Group Icon

Joined: 18 Sep, 2006
Posts: 1,353



Thanked: 27 times
Dream Kudos: 350
My Contributions
Torres, expand on this and stick it in the Tutorials section. I found it pretty useful, although further explanations could be handy.

Bort
User is offlineProfile CardPM
+Quote Post

musya

RE: Functionality Of Style Sheets

24 Feb, 2009 - 10:20 PM
Post #4

D.I.C Addict
Group Icon

Joined: 25 Apr, 2007
Posts: 726



Thanked: 8 times
Dream Kudos: 50
My Contributions
Odd that he just posted once about CSS and then never came back.
User is offlineProfile CardPM
+Quote Post

gabehabe

RE: Functionality Of Style Sheets

7 Mar, 2009 - 03:48 AM
Post #5

Sexy DIC
Group Icon

Joined: 6 Feb, 2008
Posts: 8,829



Thanked: 175 times
Dream Kudos: 3275
Expert In: Lots of things.

My Contributions
Holy crap ~ all this time later, and I've only just realised it's a very clever advertisement, with a sneaky link thrown in there once and once only.

Pure genius.
User is online!Profile CardPM
+Quote Post

firebolt

RE: Functionality Of Style Sheets

18 Apr, 2009 - 01:46 AM
Post #6

D.I.C Lover
Group Icon

Joined: 20 Feb, 2009
Posts: 5,463



Thanked: 75 times
Dream Kudos: 1675
My Contributions
He should have also put that link in the advertising forum. clever guy.
User is offlineProfile CardPM
+Quote Post

Ludwig the Mad

RE: Functionality Of Style Sheets

14 May, 2009 - 10:17 PM
Post #7

New D.I.C Head
*

Joined: 21 Apr, 2009
Posts: 26


My Contributions
QUOTE(Torres58 @ 5 Jul, 2008 - 01:23 AM) *

There is a fourth style sheet which is set not by the document author but by the reader and that is the browser default. Taking this style sheet into consideration the order of precedence is: Inline Style (inside HTML element), Embedding Style Sheet (inside the <head> tag), External Style Sheet and Browser default. So, an inline style (inside an HTML element) has the highest priority, which means that it will override every style declared inside the <head> tag, in an external style sheet, and in a browser (a default value).


I found the wording of this somewhat ambiguous. Where Torres58 says "External Style Sheet and Browser Default" does that mean that External Style Sheet and Browser default have the same precedence or does that mean External Style Sheet and then Browser Default?

User is offlineProfile CardPM
+Quote Post

gregwhitworth

RE: Functionality Of Style Sheets

29 Jul, 2009 - 08:00 AM
Post #8

(this).problem + "sucks";
Group Icon

Joined: 20 Jan, 2009
Posts: 1,131



Thanked: 82 times
Dream Kudos: 50
Expert In: HTML, CSS, Web Design

My Contributions
QUOTE
External Style Sheet and then Browser Default?


The browser/USER always trump the website settings. For instance you can make it so that all links are red and bold, with double underlines even though they may be red with no underline.

--

Greg

This post has been edited by gregwhitworth: 29 Jul, 2009 - 08:01 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic

Time is now: 11/8/09 01:58AM

Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month