Tweaking the style of child elements inline

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

    Tweaking the style of child elements inline

    Hi,

    It's interesting if it is possible to use CSS rules for styling child
    elements inline? What I mean is if there is a way to apply CSS rules
    like this:

    <ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
    way -->
    <li>Item1</li>
    <li>Item2</li>
    <li>Item3</li>
    </ul>

    I would like to apply some styles for child elements inline just like
    we can do this as usual:

    <style type="text/css">
    li{margin: 0;}
    </style>

    Thank you.
  • Martin Honnen

    #2
    Re: Tweaking the style of child elements inline

    alainfri@gmail. com wrote:
    It's interesting if it is possible to use CSS rules for styling child
    elements inline? What I mean is if there is a way to apply CSS rules
    like this:
    >
    <ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
    way -->
    I don't think it is possible, the style attribute value is a list of CSS
    properties with property name and value. You are trying to put a CSS
    rule in there but that is not possible.


    --

    Martin Honnen

    Comment

    • Ben C

      #3
      Re: Tweaking the style of child elements inline

      On 2008-03-01, Martin Honnen <mahotrash@yaho o.dewrote:
      alainfri@gmail. com wrote:
      >
      >It's interesting if it is possible to use CSS rules for styling child
      >elements inline? What I mean is if there is a way to apply CSS rules
      >like this:
      >>
      ><ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
      >way -->
      >
      I don't think it is possible, the style attribute value is a list of CSS
      properties with property name and value. You are trying to put a CSS
      rule in there but that is not possible.
      Indeed, although something like it was proposed at some time. I don't
      know what happened but I don't think anyone's implemented it.

      Comment

      • Jukka K. Korpela

        #4
        Re: Tweaking the style of child elements inline

        Scripsit alainfri@gmail. com:
        It's interesting if it is possible to use CSS rules for styling child
        elements inline?
        It's off-topic in this group.
        <ul style="li{ margin: 0; }"<!-- NOT SURE if it is possible in some
        way -->
        You're apparently thinking that there's something that prevents you from
        using CSS normally. Making things up won't help. Please note that all
        c.i.w.a.* groups are supposed to discuss authoring of WWW pages.

        --
        Jukka K. Korpela ("Yucca")


        Comment

        • alainfri@gmail.com

          #5
          Re: Tweaking the style of child elements inline

          On Mar 1, 8:16 pm, "Jukka K. Korpela" <jkorp...@cs.tu t.fiwrote:
          Scripsit alain...@gmail. com:
          >
          It's interesting if it is possible to use CSS rules for styling child
          elements inline?
          >
          It's off-topic in this group.
          >
          <ul style="li{ margin: 0; }"<!--  NOT SURE if it is possible in some
          way -->
          >
          You're apparently thinking that there's something that prevents you from
          using CSS normally. Making things up won't help. Please note that all
          c.i.w.a.* groups are supposed to discuss authoring of WWW pages.
          >
          --
          Jukka K. Korpela ("Yucca")http://www.cs.tut.fi/~jkorpela/
          The logic is that if inline styles are supported, then in some
          particular cases you may find them useful. Of course, the least thing
          I would like to do here is "to make things up". But you may agree with
          me that again in some cases it can be quite handy to have such a
          feature. CSS is evolving in such a way that newer versions allow you
          to do things faster and reduce the amount of code. Thank you all for
          participating in this discussion in any case. I thought I may have
          missed this feature but it turns out it is not the case.

          Comment

          • example@example.com

            #6
            Re: Tweaking the style ..., Mr. Korpela

            Jukka K. Korpela wrote:
            Please note that all c.i.w.a.* groups are supposed to
            discuss authoring of WWW pages.
            Then why don't you do that? Normally you are a very good
            contributor to newsgroups, but lately all we have heard
            from you is criticism of the way people ask questions.

            If you don't have anything to contribute, then don't post.

            Comment

            Working...