treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Solid colour best practise

  • Hi!!

    I'd like to use blocks of solid colour to use as spacers in my site. Would the best practise be

    1. Divs with background colour


    <div class="spacer-200 green">&nbsp;</div>

    with css like

    .spacer-200
    {
    width:200px;
    height:10px;
    }

    .green
    {
    background-color:#0F0;
    }


    2. 1px (or some size) Images of set colour, ie:


    <img src="images/green.jpg" width="200" height="10"/>


    Or another method altogether?

    Thanks!

    Dave
  • If they are just spacers, you can simply add a bottom-border to the div, as opposed to adding a whole other div as a separator.
  • Hiya, just realised I never replied. Thanks a lot buddy!!