Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 8 of 8
  1. #1
    Senior Member
    Join Date
    Feb 2005
    Location
    Canada
    Posts
    435
    Member #
    8983
    I have worked a little with html, javascript, and css and know the languages but would like to know something. Should i use only css to layout content or should I use another method. I don't know about tables due to accessability issues but and if I use css what syntax should use in the past is used:
    Code:
    object{position:absolute;left:20%;top:20%;}
    should i chosse a different method or keep useing this one?
    Thee Pyro Wolf

  2.  

  3. #2
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    Purists would say that layout should be totally controlled by stylesheets.

    A lot of folks do still use tables for layout, though... there is no "right or wrong" in this regard. Tables are restricting, in that they limit what you can do regarding positioning to rows and columns, and they can also "break" if you put too much content into a cell. On the other hand they tend to be more consistent across browsers... unfortunately IE is an absolute nightmare in terms of standards compliance.

    When it comes to <font> tags and the like, however, you should definitely use CSS. The tag is deprecated and therefore should not be used. Similarly things like <center>, <b>, <i> etc. are all big no-nos.

    Sean

  4. #3
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    What's wrong with <b> and <i>? I use them quite often.

  5. #4
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Times change. If you want to style a small amount of text as bold or italic, use a span and css

    PHP Code:
    <span style="font-weight: bold;">bolded text in here</span
    Or if it is a bigger area/more content you wish to style, consider using a <div>.

    Note: Styling spans/divs/infact any element via the style attribute soon makes lines of code into large lines of code.

    Consider making a style rule for a element, and instead of using the style attribute you would use the class attribute..

    PHP Code:
    <span class="ClassName">text</span
    And of course place all css in a .css file and link to it with this code..

    PHP Code:
    <link rel="stylesheet" type="text/css" href="style.css" media="all" /> 
    Hope this helps.

  6. #5
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    There are accessibility issues when using spans to style text as such. It also seems less efficient.

    Sorry to take this thread off topic...

  7. #6
    Senior Member seanmiller's Avatar
    Join Date
    Sep 2003
    Location
    Glastonbury, UK
    Posts
    868
    Member #
    3263
    Liked
    1 times
    I suppose this thing can be argued either way... clearly the W3C saw that there was a potential conflict here which is why they left <b> and <i> as part of the XHTML specification... something I hadn't realised they'd done.

    I suppose it could be argued that italicising or bolding text is not part of the presentation, it's part of the content, as it is a form of emphasising what is being said... however, that said, I would much rather define styles for these things as you gain far more control over your look and feel.

    I guess you could define how you wanted <b> and <i> to behave in your stylesheet... thus gaining more control...

    Sean

    ps. Eddy, please clarify what accessibility issues using spans to style text raises... I am not aware of any.

  8. #7
    Senior Member Eddy Bones's Avatar
    Join Date
    Jan 2004
    Location
    Washington, USA
    Posts
    1,054
    Member #
    4651
    Can screen readers such as RealSpeak and WordRead add emphasis to words that are styled with spans? Maybe I'm wrong about accessability and maybe I should have not made that claim.

    It seems safer to use <em> or <strong> even.

  9. #8
    Senior Member DanielOliver's Avatar
    Join Date
    Jun 2003
    Location
    Cornwall, England.
    Posts
    1,202
    Member #
    1879
    <strong> and <em> are replacements for <b> and <i>

    You should only use these if you want added emphasis on words. If you don't you are supposed to use <span>s

    This is because screen readers will add emphasis when reading <strong> or <em> words. If you don't want this you should use spans. If you do then do.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 02:41 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com