File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Applying styles in CSS

 
Rajesh Khan
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i was hoping to get a little help on this issue
I actually wanted to know what the difference is between these two


Here is my understanding of .upload label which i am sure is correct
this means apply the style to all the label tags in the upload class

Now i am a bit confused with the label.upload but i think it means
apply this style to all the label tags in the upload class. (is this correct??) if so then why doesnt the style take effect if i replace .upload label with label.upload in the following example


<style type="text/css">
.upload {width:80em;background-color:red}
.upload label {width: 8.5em;float: left;text-align: left;margin-right: 0.9em;margin-left: 1em ; position:relative ; top:4px;background-color:blue}
</style>

<div class="upload">
<label>labelA</label <br>
<label>labelB</label><br>
</div>
 
Marcin Kwiatkowski
Ranch Hand
Posts: 32
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
label.upload matches label element with upload class: <label class="upload">
 
Rajesh Khan
Ranch Hand
Posts: 230
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marcin Kwiatkowski wrote:label.upload matches label element with upload class: <label class="upload">

What does that mean ?? sorry i am a bit confused with your explaination . does this mean
"apply the given style to all label tags in the upload " ??
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read this: http://htmlhelp.com/reference/css/structure.html

Eric
 
Marcin Kwiatkowski
Ranch Hand
Posts: 32
Eclipse IDE Java Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it means "apply the given style to all label tags with upload class", so that it would be applied to <label class="upload">...</label>, but not to <label>...</label>
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rajesh Khan wrote:Here is my understanding of .upload label which i am sure is correct
this means apply the style to all the label tags in the upload class

Apply the rule to all label elements that are descendants of an element with the class upload.

Now i am a bit confused with the label.upload but i think it means
apply this style to all the label tags in the upload class. (is this correct??)

Apply the rule to all label elements with the class upload.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic