Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS CSS newbie

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #32133
    irfan
    Member

    Hi,
    Im a beginner in CSS. pls clarify my doubt.
    I have to make a red coloured box and blue coloured box aligned horizontally. So i wrote the code as
    HTML:





    and CSS for that as


    #container{ border:1px solid #000; overflow:auto;position:relative;}
    #container div { width:40%; height:30px;}
    #red { background-color:#F00; left:0}
    #blue { background-color:#006; right:0}

    But the boxes are appearing to be vertically stacked one over the other.How to make them horizontal ?

    #53631
    mixxmac
    Member

    You probably want to float the #red and #blue boxes to the left. @TheDoc posted some good links about this recently.

    https://css-tricks.com/forums/discussion/11137/floats-got-you-down/p1

    #53632

    @irfan – Here you go.

    http://jsfiddle.net/93Svy/

    Read up on floats, and you’ll see how easy it was to make this happen. Cheers!

    #53600
    irfan
    Member

    @mixxmac @aaronsilber thanks buddies

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘CSS’ is closed to new topics and replies.