The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> <link rel="stylesheet" href="style.css" id="">?
robby
post Feb 15 2009, 09:08 PM
Post #1


Newbie
*

Group: Members
Posts: 11
Joined: 22-December 08
Member No.: 7,386



What does an id on a stylesheet do and how can it be done? I always thought stylesheets only gave elements ids but never had one as well. I guess that's not the case. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 16 2009, 02:02 AM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



The class and id attributes are useful as selectors, so you can apply CSS rules only to some instances of an element (class), or only to a specific instance of an element (id).

See also CSS Structure and Rules in our CSS reference.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 16 2009, 03:33 AM
Post #3


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



Almost all elements can have an ID. Maybe it's used for scripting purposes in this case?
http://www.w3.org/TR/html401/index/attributes.html
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Feb 16 2009, 04:05 AM
Post #4


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



Sorry, I just reread the question (or rather, I read the subject line and the question together). You aren't asking how id attributes are used in style sheets, but how they're used in link elements for style sheets.

In addition to any scripting-related reasons, it is possible to have alternative style sheets. The older examples show the title attribute used to distinguish among various alternative style sheets, but perhaps some are using id instead.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
robby
post Feb 16 2009, 11:41 AM
Post #5


Newbie
*

Group: Members
Posts: 11
Joined: 22-December 08
Member No.: 7,386



Alright, thanks happy.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 01:48 AM