remove formatting for certain objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • hendedav@yahoo.com

    remove formatting for certain objects

    Gang,

    I am trying to create/update webpages using CSS and modern
    programming (getting away from using tables to place text and
    objects). I am running into an issue using ul's. I will give you the
    code below:

    <ul class="liCol1">
    <li>Vendor name</li>
    <li>Address</li>
    <li>City St, Zip</li>
    <li>Phone number</li>
    <li class="liSpacer ">&nbsp;</li>
    <li>Data directory</li>
    <li>Temp directory</li>
    <li class="liSpacer ">&nbsp;</li>
    <li>DSA keys</li>
    </ul>

    and here is the css from an external file:

    ..ulCol1 {
    list-style: none;
    text-decoration: none;
    margin: 0px;
    padding: 0px;
    }

    ..liCol1 li {
    margin: 4 0 0 0;
    height: 17px;
    }

    ..liSpacer {
    margin: 0px;
    padding: 0px;
    height: 12px;
    font-size: 10px;
    }

    This works just fine for the li's that have text in them. The ones
    that have the class="liSpacer " don't seem to use css that is given.
    Why would this not take effect? Is there a way that I can stop
    inheritence from the ".liCol1 li" section? Any help would greatly be
    appreciated.

    Also note, that there may be several of these on a page so I was
    trying to avoid giving each ul an id.

  • dorayme

    #2
    Re: remove formatting for certain objects

    In article
    <1170292375.518 203.90400@p10g2 000cwp.googlegr oups.com>,
    hendedav@yahoo. com wrote:
    Gang,
    >
    I am trying to create/update webpages using CSS and modern
    programming (getting away from using tables to place text and
    objects). I am running into an issue using ul's. I will give you the
    code below:
    >
    <ul
    that have the class="liSpacer " don't seem to use css that is given.
    Why would this not take effect? Is there a way that I can stop
    inheritence from the ".liCol1 li" section? Any help would greatly be
    appreciated.
    >
    Also note, that there may be several of these on a page so I was
    trying to avoid giving each ul an id.
    You could look at simply classing some of the <li>s - either at
    the top or bottom of the junctures wanted - and assign bigger
    bottom or top margins. There is an example of this sort of thing
    at:

    <http://sn2.com.au>

    --
    dorayme

    Comment

    • Ben C

      #3
      Re: remove formatting for certain objects

      On 2007-02-01, hendedav@yahoo. com <hendedav@yahoo .comwrote:
      Gang,
      >
      I am trying to create/update webpages using CSS and modern
      programming (getting away from using tables to place text and
      objects). I am running into an issue using ul's. I will give you the
      code below:
      [snip]
      .liCol1 li {
      margin: 4 0 0 0;
      height: 17px;
      }
      >
      .liSpacer {
      margin: 0px;
      padding: 0px;
      height: 12px;
      font-size: 10px;
      }
      >
      This works just fine for the li's that have text in them. The ones
      that have the class="liSpacer " don't seem to use css that is given.
      It looks like .liCol1 li is more "specific" than .liSpacer. See CSS 2.1
      6.4.3.
      Why would this not take effect?
      If you make ".liSpacer" ".liCol1 li.liSpacer" instead, it will become
      more specific (two classes and one element beats one class and one
      element).
      Is there a way that I can stop inheritence from the ".liCol1 li"
      section? Any help would greatly be appreciated.
      Not that I know of. You can give all the non-spacer <li>s their own
      class and then you can select them with a selector that won't match the
      spacers as well. Otherwise override everthing you set in .liCol1 li in
      ..liCol1 li.liSpacer to set it back to the default.

      Comment

      • Jukka K. Korpela

        #4
        Re: remove formatting for certain objects

        Scripsit hendedav@yahoo. com:
        I am trying to create/update webpages using CSS and modern
        programming (getting away from using tables to place text and
        objects).
        Whether you use modern programming is immaterial. CSS is not programming,
        though you can write programs that generate, read, modify, or interpret CSS
        code.

        There is nothing wrong with using tables when you have tabular data. Whether
        an address is tabular data is debatable, but the fact is that there are
        authors who are "getting aways from using tables" in vain, even making their
        pages less logical and more difficult to maintain.
        I am running into an issue using ul's.
        When you have run into an issue with CSS, it's virtually always a waste of
        everyone's time to post a question without revealing the URL.
        I will give you the code below:
        You are not giving yourself good chances of getting the help you need.
        <ul class="liCol1">
        <li>Vendor name</li>
        <li>Address</li>
        <li>City St, Zip</li>
        <li>Phone number</li>
        <li class="liSpacer ">&nbsp;</li>
        <li>Data directory</li>
        <li>Temp directory</li>
        <li class="liSpacer ">&nbsp;</li>
        <li>DSA keys</li>
        </ul>
        What's "liCol1"? Class names should be descriptive of meaning and structure,
        not cryptic codes for intended formatting.

        Why the spacer items? Use vertical margins instead.
        and here is the css from an external file:
        >
        .ulCol1 {
        list-style: none;
        text-decoration: none;
        margin: 0px;
        padding: 0px;
        }
        Why do you present this snippet? There is no class "ulCOl1" in your markup
        snippet.
        .liCol1 li {
        margin: 4 0 0 0;
        height: 17px;
        }
        4 of what? Did you forget to use the "CSS Validator" to check whether your
        style sheet is even formally correct? Why 17px? The px unit should normally
        be used in user style sheets only. Why do you set the height in the first
        place?
        .liSpacer {
        margin: 0px;
        padding: 0px;
        height: 12px;
        font-size: 10px;
        }
        Instead, assign a class to an item after which some spacing is desired, and
        simply set e.g. margin-bottom: 1em for it.
        This works just fine
        No it doesn't.
        for the li's that have text in them. The ones
        that have the class="liSpacer " don't seem to use css that is given.
        That element also has text in it, though just one character. It's a wrong
        approach, but technically it's an element with text content.
        Why would this not take effect?
        It's pretty futile to discuss that, since the approach is wrong, you didn't
        reveal the URL, and you're not telling what you mean by its not taking
        effect.
        Is there a way that I can stop
        inheritence from the ".liCol1 li" section?
        There is no such thing as inheritance from a section. Elements may inherit a
        property value from their parent. The way to stop that is to assign a value
        to the property for that element.

        As a rule of thumb, 105 % of all CSS questions with the word "inheritanc e"
        in them are seriously misguided and do not actually deal with inheritance at
        all.

        --
        Jukka K. Korpela ("Yucca")


        Comment

        • hendedav@yahoo.com

          #5
          Re: remove formatting for certain objects

          On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
          Scripsit hende...@yahoo. com:
          >
          I am trying to create/update webpages using CSS and modern
          programming (getting away from using tables to place text and
          objects).
          >
          Whether you use modern programming is immaterial. CSS is not programming,
          though you can write programs that generate, read, modify, or interpret CSS
          code.
          >
          There is nothing wrong with using tables when you have tabular data. Whether
          an address is tabular data is debatable, but the fact is that there are
          authors who are "getting aways from using tables" in vain, even making their
          pages less logical and more difficult to maintain.
          >
          I am running into an issue using ul's.
          >
          When you have run into an issue with CSS, it's virtually always a waste of
          everyone's time to post a question without revealing the URL.
          >
          I will give you the code below:
          >
          You are not giving yourself good chances of getting the help you need.
          >
          <ul class="liCol1">
          <li>Vendor name</li>
          <li>Address</li>
          <li>City St, Zip</li>
          <li>Phone number</li>
          <li class="liSpacer ">&nbsp;</li>
          <li>Data directory</li>
          <li>Temp directory</li>
          <li class="liSpacer ">&nbsp;</li>
          <li>DSA keys</li>
          </ul>
          >
          What's "liCol1"? Class names should be descriptive of meaning and structure,
          not cryptic codes for intended formatting.
          >
          Why the spacer items? Use vertical margins instead.
          >
          and here is the css from an external file:
          >
          .ulCol1 {
          list-style: none;
          text-decoration: none;
          margin: 0px;
          padding: 0px;
          }
          >
          Why do you present this snippet? There is no class "ulCOl1" in your markup
          snippet.
          >
          .liCol1 li {
          margin: 4 0 0 0;
          height: 17px;
          }
          >
          4 of what? Did you forget to use the "CSS Validator" to check whether your
          style sheet is even formally correct? Why 17px? The px unit should normally
          be used in user style sheets only. Why do you set the height in the first
          place?
          >
          .liSpacer {
          margin: 0px;
          padding: 0px;
          height: 12px;
          font-size: 10px;
          }
          >
          Instead, assign a class to an item after which some spacing is desired, and
          simply set e.g. margin-bottom: 1em for it.
          >
          This works just fine
          >
          No it doesn't.
          >
          for the li's that have text in them. The ones
          that have the class="liSpacer " don't seem to use css that is given.
          >
          That element also has text in it, though just one character. It's a wrong
          approach, but technically it's an element with text content.
          >
          Why would this not take effect?
          >
          It's pretty futile to discuss that, since the approach is wrong, you didn't
          reveal the URL, and you're not telling what you mean by its not taking
          effect.
          >
          Is there a way that I can stop
          inheritence from the ".liCol1 li" section?
          >
          There is no such thing as inheritance from a section. Elements may inherit a
          property value from their parent. The way to stop that is to assign a value
          to the property for that element.
          >
          As a rule of thumb, 105 % of all CSS questions with the word "inheritanc e"
          in them are seriously misguided and do not actually deal with inheritance at
          all.
          >
          --
          Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/


          Jukka,

          I am not sure how to take your response to my post. If it was
          meant as a sincere reply explaining certain aspects, then I will
          appreciate it. If you were responding with an attitude towards
          someone who is trying to learn correct ways of coding, then I would
          ask you not to reply.

          Comment

          • hendedav@yahoo.com

            #6
            Re: remove formatting for certain objects

            On Feb 1, 3:37 am, Ben C <spams...@spam. eggswrote:
            On 2007-02-01, hende...@yahoo. com <hende...@yahoo .comwrote:
            >
            Gang,
            >
            I am trying to create/update webpages using CSS and modern
            programming (getting away from using tables to place text and
            objects). I am running into an issue using ul's. I will give you the
            code below:
            >
            [snip]
            >
            .liCol1 li {
            margin: 4 0 0 0;
            height: 17px;
            }
            >
            .liSpacer {
            margin: 0px;
            padding: 0px;
            height: 12px;
            font-size: 10px;
            }
            >
            This works just fine for the li's that have text in them. The ones
            that have the class="liSpacer " don't seem to use css that is given.
            >
            It looks like .liCol1 li is more "specific" than .liSpacer. See CSS 2.1
            6.4.3.
            >
            Why would this not take effect?
            >
            If you make ".liSpacer" ".liCol1 li.liSpacer" instead, it will become
            more specific (two classes and one element beats one class and one
            element).
            >
            Is there a way that I can stop inheritence from the ".liCol1 li"
            section? Any help would greatly be appreciated.
            >
            Not that I know of. You can give all the non-spacer <li>s their own
            class and then you can select them with a selector that won't match the
            spacers as well. Otherwise override everthing you set in .liCol1 li in
            .liCol1 li.liSpacer to set it back to the default.

            Thanks guys for the input. I will play around with what you suggested
            and see if I can get things working.

            Comment

            • Jukka K. Korpela

              #7
              Re: remove formatting for certain objects

              Scripsit hendedav@yahoo. com:
              Jukka,
              We are not in a first-name basis, especially since you are cowardish enough
              to hide yours.
              I would ask you not to reply.
              By fullquoting a useful answer and by not addressing any of the concerns
              there, including the absence of a URL, you already asked all knowledgeable
              people to ignore your further posts.

              HTH. HAND.

              --
              Jukka K. Korpela ("Yucca")


              Comment

              • Ben C

                #8
                Re: remove formatting for certain objects

                On 2007-02-01, hendedav@yahoo. com <hendedav@yahoo .comwrote:
                On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
                [snip]
                >As a rule of thumb, 105 % of all CSS questions with the word "inheritanc e"
                >in them are seriously misguided and do not actually deal with inheritance at
                >all.
                >>
                >--
                >Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
                >
                >
                >
                Jukka,
                >
                I am not sure how to take your response to my post. If it was
                meant as a sincere reply explaining certain aspects, then I will
                appreciate it. If you were responding with an attitude towards
                someone who is trying to learn correct ways of coding, then I would
                ask you not to reply.
                Don't worry about Mr Korpela. He has a certain asperity, but makes good
                technical points and my impression is that he is not really a bully.

                Comment

                • hendedav@yahoo.com

                  #9
                  Re: remove formatting for certain objects

                  On Feb 1, 2:14 pm, Ben C <spams...@spam. eggswrote:
                  On 2007-02-01, hende...@yahoo. com <hende...@yahoo .comwrote:
                  >
                  >
                  >
                  On Feb 1, 6:30 am, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
                  [snip]
                  As a rule of thumb, 105 % of all CSS questions with the word "inheritanc e"
                  in them are seriously misguided and do not actually deal with inheritance at
                  all.
                  >
                  --
                  Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
                  >
                  Jukka,
                  >
                  I am not sure how to take your response to my post. If it was
                  meant as a sincere reply explaining certain aspects, then I will
                  appreciate it. If you were responding with an attitude towards
                  someone who is trying to learn correct ways of coding, then I would
                  ask you not to reply.
                  >
                  Don't worry about Mr Korpela. He has a certain asperity, but makes good
                  technical points and my impression is that he is not really a bully.


                  Thats why I worded my post the way I did... basically if you are being
                  helpful and not a bully thank you... if not keep to yourself. Thanks
                  again for your help. I tried doing what you said and it worked out
                  perfectly. Have a good one.

                  Comment

                  • -Lost

                    #10
                    Re: remove formatting for certain objects

                    <hendedav@yahoo .comwrote in message
                    news:1170362573 .361423.100990@ a34g2000cwb.goo glegroups.com.. .
                    On Feb 1, 2:14 pm, Ben C <spams...@spam. eggswrote:
                    I am not sure how to take your response to my post. If it was
                    meant as a sincere reply explaining certain aspects, then I will
                    appreciate it. If you were responding with an attitude towards
                    someone who is trying to learn correct ways of coding, then I would
                    ask you not to reply.
                    >>
                    >Don't worry about Mr Korpela. He has a certain asperity, but makes good
                    >technical points and my impression is that he is not really a bully.
                    >
                    Thats why I worded my post the way I did... basically if you are being
                    helpful and not a bully thank you... if not keep to yourself. Thanks
                    again for your help. I tried doing what you said and it worked out
                    perfectly. Have a good one.
                    Geniuses have a tendency to "talk at" or "down" to you without an implied arrogance or
                    measure of disrespect.

                    Taking it personally on a newsgroup though only makes you look even sillier.

                    Take your own advice and just do not respond to Jukka when you feel he is being
                    overbearing. (He is definitely smart though, so pay attention to him at least.)

                    Just my $0.02. And no, I do not have an attitude just in case your first thought is to
                    reply as such.

                    Be well.

                    -Lost


                    Comment

                    • zzpat

                      #11
                      Re: remove formatting for certain objects

                      hhendedav@yahoo .com wrote:
                      Gang,
                      >
                      I am trying to create/update webpages using CSS and modern
                      programming (getting away from using tables to place text and
                      objects). I am running into an issue using ul's. I will give you the
                      code below:
                      >
                      <ul class="liCol1">
                      <li>Vendor name</li>
                      <li>Address</li>
                      <li>City St, Zip</li>
                      <li>Phone number</li>
                      <li class="liSpacer ">&nbsp;</li>
                      <li>Data directory</li>
                      <li>Temp directory</li>
                      <li class="liSpacer ">&nbsp;</li>
                      <li>DSA keys</li>
                      </ul>
                      >
                      and here is the css from an external file:
                      >
                      .ulCol1 {
                      list-style: none;
                      text-decoration: none;
                      margin: 0px;
                      padding: 0px;
                      }
                      >
                      .liCol1 li {
                      margin: 4 0 0 0;
                      height: 17px;
                      }
                      >
                      .liSpacer {
                      margin: 0px;
                      padding: 0px;
                      height: 12px;
                      font-size: 10px;
                      }
                      >
                      This works just fine for the li's that have text in them. The ones
                      that have the class="liSpacer " don't seem to use css that is given.
                      Why would this not take effect? Is there a way that I can stop
                      inheritence from the ".liCol1 li" section? Any help would greatly be
                      appreciated.
                      >
                      Also note, that there may be several of these on a page so I was
                      trying to avoid giving each ul an id.
                      >
                      Try this.

                      ..liSpacer {
                      list-style-type:none;
                      }

                      Comment

                      Working...