SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    Dewsbury, UK
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    using pre tag in a bad way for design

    hi guys
    so i decided to make my first page on my first ever site i thought i would make it xhtml transitional with a 3 column css design

    i didnt want to make use of any tables on the site but i came across a problem which would have looked better in tables

    i overcame (well soft of) the problem by using the pre tag and using tab spaces to align the checkboxes on the page

    this seemed ok, but doing so messed up the validation of the page - so does anyone know how i can make the pre tag xhtml transitional combatible ?

    do you think it is a good idea to use the pre tag in this way or should i just use tables ?

    the page which i am talking about is http://www.thewizsite.com/tools/jspuwg.htm and this is the validation page

    note that there is nothing else on the site

    thanks ya all

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,516
    Mentioned
    182 Post(s)
    Tagged
    6 Thread(s)
    Hi,
    this seemed ok, but doing so messed up the validation of the page - so does anyone know how i can make the pre tag xhtml transitional combatible ?
    The pre tag is a block level tag and cannot be nested inside a paragraph <p> tag. Simply remove the paragraph tags from around the pre tags and your page will validate.

    do you think it is a good idea to use the pre tag in this way or should i just use tables
    No I thinks it's a bad idea as you are not separating prentation from content and the pre tag is really for pre formatted text and not your page layout.

    I don't see any need for tables as you could just float the elements left/right as required or even place them absolutely if needs be.

    For some examples look here:

    http://www.alistapart.com/articles/practicalcss/
    http://www.sitepoint.com/article/1166

    Also note that you should include html comment tags in your external css file. Only css and css comments /*comments*/ are allowed.

    Hope that helps.

    Paul

  3. #3
    SitePoint Enthusiast
    Join Date
    Dec 2002
    Location
    Dewsbury, UK
    Posts
    79
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow thanks [color=rgb(255, 102, 0)]Paul O'B[/color]

    i think i will do as you said and get rid of the p tag for the time being
    the links you gave are excellent

    now i have to learn this stuff at alistapart!

    thanks


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •