XHTML strict DTD questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Decorte
    New Member
    • Sep 2006
    • 6

    XHTML strict DTD questions

    Hello,
    It is my understanding that you cannot use the element "align" in a strict DTD XHTML page. This is not working for me: float: center
    which I thought was the correct way to do it. Any ideas??

    Also, I have about 8 separate headings that all have the following attributes:
    color:green; font-family:sans-serif; font-weight:bold
    How would I code these all at once using a style sheet in the head? What would the coding be in the body section? Would I use the span element??

    Thank you in advance.
    Decorte
  • Decorte
    New Member
    • Sep 2006
    • 6

    #2
    Sorry, when I said that I have 8 separate headings I meant to say that I have 8
    separate items that are within the <dt> tags.
    Thanks again,
    Decorte

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      center is not an valid value for float, if you want something in the center just center it either using text-align: center; on it's parent if it is an inline element or setting left and right margins to auto (and a width) if it is a block element.

      To set the styling color:green; font-family:sans-serif; font-weight:bold on multiple elemnts just create a class

      [html]
      .someMeaningful Name {
      color:green;
      font-family:sans-serif;
      font-weight:bold ;
      }

      ...

      <dt class="someMean ingfulName">Bla h Blah Blah</dt>
      [/html]

      Another alternitive that takes less typing is to set a class or id on a parent element

      [html]
      #SomeMeaningful Name dt {
      color:green;
      font-family:sans-serif;
      font-weight:bold ;
      }

      ...

      <dl id="SomeMeaninf ulName">
      <dt>This element gets the green etc styling</dt>
      </dl>
      [/html]

      This is handy way to keep the html fairly clean from extra class attributes but still control your presentation.

      Comment

      • Decorte
        New Member
        • Sep 2006
        • 6

        #4
        Thank you very much Banfa I'll give your suggestions a whirl.
        I greatly appreciate your advice!
        Decorte
        P.S. - I find this "Strict stuff a bit confusing at times"

        Comment

        • drhowarddrfine
          Recognized Expert Expert
          • Sep 2006
          • 7434

          #5
          There is nothing confusing about 'this strict stuff'. Strict only means you have to follow the current rules and you can't use the old tags.

          Comment

          • Decorte
            New Member
            • Sep 2006
            • 6

            #6
            To me "Strict" is a bit confusing considering that I just took a whole course on HTML (8 weeks worth). I also did one week of XHTML and one week of CSS.
            So.........when the strict came in during the XHTML portion of my course it kind of through me off.
            Decorte
            P.S. - I knew nothing about web page designing before I took this course!

            Comment

            • drhowarddrfine
              Recognized Expert Expert
              • Sep 2006
              • 7434

              #7
              "Sometimes you have to run as fast as you can just to stay where you are." --The Queen of Hearts, Alice in Wonderland.

              Comment

              • Decorte
                New Member
                • Sep 2006
                • 6

                #8
                You got that right!!
                Thanks again,
                Decorte

                Comment

                Working...