SunQuest
           CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 29th, 2001, 12:34 AM
edwinx edwinx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: vancouver, bc
Posts: 142 edwinx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 43 sec
Reputation Power: 9
Send a message via ICQ to edwinx
css classes

hi,

Is it possible to declare a class and then apend another class to that class when needed??

eg.

.blue {
color: blue
}

.bold {
font-weight: bold
}

then use it like this:

<div class="bold">blue text</div>
<br>
<div class="blue.bold">blue and bold</div> <--- so the text here is bold and blue.

I know that is not the correct way of using it but how would I do this in CSS?

thanks
edwin
__________________
I know nothing

Last edited by edwinx : November 29th, 2001 at 12:37 AM.

Reply With Quote
  #2  
Old November 29th, 2001, 02:24 AM
Inch Inch is offline
Discombobulated Radish
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 21 Inch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Never come across that way of using CSS. This probably doesn't help and is stating the obvious, but why can't you just declare a new class? Using your example:

.blue {
color: blue;
}

.bold {
font-weight: bold
}

.boldblue {
color: blue;
font-weight: bold;
}

Are your classes so detailed that you can't declare a new one?



Inch

Reply With Quote
  #3  
Old November 29th, 2001, 03:22 AM
edwinx edwinx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: vancouver, bc
Posts: 142 edwinx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 43 sec
Reputation Power: 9
Send a message via ICQ to edwinx
Quote:
Originally posted by Inch
Never come across that way of using CSS. This probably doesn't help and is stating the obvious, but why can't you just declare a new class? Using your example:

.blue {
color: blue;
}

.bold {
font-weight: bold
}

.boldblue {
color: blue;
font-weight: bold;
}

Are your classes so detailed that you can't declare a new one?



Inch


hmm..i guess.

what i'm trying to do is make a class called .indent and apply that whenever needed without making a whole new class called .body1text-indent.

and how would i use the those psuedo class features of CSS? i read through some examples but it hasn't sunk in yet..

thanks!
edwin

Reply With Quote
  #4  
Old November 29th, 2001, 03:55 AM
Inch Inch is offline
Discombobulated Radish
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 21 Inch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Edwin,
What you can do if you want to indent text is just put the style element inside the <div> tag, if you don't want to create a new class.

Example

.bold {
font-weight: bold;
}

Then in the body put:

<div class="bold" style="text-indent: 10px;">Hello World</div>

This is a way round your problem, but I still think the best way is as follows:

<head>
<style type="text/css">

.bold {
font-weight: bold;
}

.boldindent {
font-weight: bold;
text-indent: 10px;
}
</style>
</head>

<body>
<div class="bold">Hello World</div>
<div class="boldindent"> Hello World</div>


Hope this helps....

Reply With Quote
  #5  
Old November 29th, 2001, 07:55 AM
neocookie neocookie is offline
Seaweed eating techaholic.
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: Stockport, UK
Posts: 13 neocookie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Try this:

Code:
<html>
<head>
	<style>
	.bold { font-weight: bold }
	.blue { color: blue }
	</style>
</head>
<body>
<div class="blue bold">This is bolded blue text</div>
</body>
</html>


Works in IE6, not tested anywhere else.


Reply With Quote
  #6  
Old November 29th, 2001, 08:09 AM
Inch Inch is offline
Discombobulated Radish
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2001
Posts: 21 Inch User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
neocookie,

That method doesn't seem to work in Netscape, unfortunately. Works fine in IE though...

Inch

Reply With Quote
  #7  
Old November 29th, 2001, 07:01 PM
edwinx edwinx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: vancouver, bc
Posts: 142 edwinx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 43 sec
Reputation Power: 9
Send a message via ICQ to edwinx
is it even possible to do what i want? or is CSS limited in some ways?

edwin

Reply With Quote
  #8  
Old November 29th, 2001, 08:04 PM
edwinx edwinx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2000
Location: vancouver, bc
Posts: 142 edwinx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 36 m 43 sec
Reputation Power: 9
Send a message via ICQ to edwinx
6.4.3 Calculating a selector's specificity ?

hi,

does anyone know what section 6.4.3 means in this css reference??

<url>http://www.w3.org/TR/REC-CSS2/cascade.html</url>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > css classes


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway