StevenStark.com
Technical Blog for Joomla, LAMP and Flash Development. ALSO includes Application, interactives and game development.

...... Navigation

  • Home
  • Flash
  • Open Source
  • The Team
  • Background
  • Services
  • Portfolio
  • Projects
  • Contact

  • ...... Technical Blog

  • CMS (13)
  • Experiments (1)
  • Flash (9)
  • LAMP (1)
  • Misc (8)
  • Tutorials (5)


  • ...... Archives

  • April 2009
  • October 2008
  • March 2008
  • February 2008
  • January 2008
  • November 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • December 2006
  • August 2006
  •  

     

     

     

     

     

     

     

     

     

    < New into game development Papervision 3D 2.0 - ‘great white’ intro >

    The trick to designing with CSS

    Many people seem to over complicate things, and this is no exception with css. If you use the KISS theory, css is not only simple and fun, but cross-browser compatible!

    I’m not talking about font or p attributes, or even fancy backgrounds… all that you can figure out on your own. I am talking about managing your blocks, stopping tables and controlling the flow of your information. This is designing with CSS!

    The secrets are “position: relative;”, “float: left;”, “width:300px;”, “overflow: hidden;” when applied to a div or a span tag.

    position: relative;

    This means that the div will positioned relative to it’s place in a code, like an inline image. This is more of a ‘required’ property that you set to relative, then worry about the other properties. You need this for the float to work. I do not like using position: absolute; because it seems to have problems with rendering the exact same on other browsers.

    float: left;

    This property is similar to the align property, and you can use left or right. Left is easier for me to manage. Everything after this will align to the left of this block as if it were an image. You can stop this from happening by using a br tag like so: <br clear=”left” /> . The clear property can be left, right or all.

    width: 300px and overflow: hidden;

    Even setting max-width properties can cause div’s and span’s to still exceed their maximums on certain browsers. Setting oveverflow to hidden means that any content inside the div that is over 300px wide will not be displayed. It’s as if it doesn’t exist. This is very useful when making sure boxes stay a certain size. This can be used with width or height, or both.


    This entry was posted on Tuesday, November 27th, 2007 at 6:03 am and is filed under Misc, Tutorials.
    You can follow any responses to this entry through the RSS 2.0 feed.

    © 2000 - 2008, Steven Stark of StevenStark.com
    This site is built using: | Wordpress | Flex | Wrapper | JSON | APACHE | MySQL | PHP |
    Tech Note: Content is being parsed from XHTML and rendered inside FLEX. Hosting provided by: BlueFur