IBM developerWorks
           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 July 2nd, 2003, 11:25 AM
zeiC zeiC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 zeiC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
CSS: simple question

Hello

div
{
background-image:url("xxx.jpg");
text-color: #FFFFFF;
position:relative;
overflow: visible;
}

- This will make all the <DIV>'s on my site contain these values. How do I create two <DIV>'s with different properties? Do I have to use external stylesheets or is there another way around? Please help.

Reply With Quote
  #2  
Old July 2nd, 2003, 12:32 PM
sunfire's Avatar
sunfire sunfire is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Location: Rochester, NY
Posts: 20 sunfire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to sunfire Send a message via AIM to sunfire Send a message via Yahoo to sunfire
I don't know if this would work, but you could try making classes and then in a div tag say <div class="CLASS NAME">. This is only a guess, I have never tired it before.

Reply With Quote
  #3  
Old July 2nd, 2003, 12:35 PM
seebol seebol is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 22 seebol User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via AIM to seebol
Yeah, if you are asking what I think you are, classes should work.

in your stylesheet, you defined divs to have background xxx.jpg

div
{
background-image:url("xxx.jpg");
text-color: #FFFFFF;
position:relative;
overflow: visible;
}

suppose you wanted to produce a few divs with a background yyy.jpg You could just add this to your stylesheet:

div .y
{
background-image:url("yyy.jpg")
}

and in your body where you want the yyy div to appear, just do what sunfire said: <div class="y">blah</div>

Reply With Quote
  #4  
Old July 2nd, 2003, 12:47 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
You have lots of options. You can combine elements, such as:
Code:
body div div p b { color: red; }

which will make the text red in any bold section that's inside a paragraph that's inside a div that's inside a div that's inside a body.

Or, you can use class attributes, so with elements like:
Code:
<div>green</div>
<div class="colorme">blue</div>
<p class="colorme">red</p>

you could color them with:
Code:
div { color: green; }
.colorme { color: blue; }
p.colorme { color: red; }


You can combine both, with something like:
Code:
div.navbar ul li.navitem a { color: black; }

which will select any anchors (links) in a list item with class navitem in a unorder list in a div with class navbar.

Lastly, there are ids, which are unique, meaning that there can only be one element with each id (versus classes, where many elements can have the same class).
Code:
<div id="floater">float</div>

#floater { float: left; }

Don't try to combine ids with the other techniques (id: div p.red #item), since ids are unique and idependent of heirarchy.
__________________
-james

Reply With Quote
  #5  
Old July 2nd, 2003, 01:08 PM
zeiC zeiC is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 5 zeiC User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
thanks all... very helpful!

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > CSS: simple question


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 5 hosted by Hostway