• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Applying styles in CSS

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Ranch Hand
Posts: 32
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
label.upload matches label element with upload class: <label class="upload">
 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 " ??
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read this: http://htmlhelp.com/reference/css/structure.html

Eric
 
Marcin Kwiatkowski
Ranch Hand
Posts: 32
Eclipse IDE Ruby Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic