1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Problem with two divs side by side

Discussion in 'CSS' started by toretic, Dec 8, 2010.

  1. #1
    toretic, Dec 8, 2010 IP
  2. hardik_dan

    hardik_dan Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    in module articles same thing is achieved with tables and in other its achieved with div and ul li's. so this is happening, you need to fix your article module and use ul li in links
     
    hardik_dan, Dec 9, 2010 IP
  3. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #3
    Tables are for tabular data, CSS is for layout.
     
    CSM, Dec 9, 2010 IP
  4. toretic

    toretic Peon

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Are you certain that the problem comes from the tables? I am not? Actually i am pretty sure that the problem isnt coming from them?
     
    toretic, Dec 9, 2010 IP
  5. toretic

    toretic Peon

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Any suggestions?
     
    toretic, Dec 10, 2010 IP
  6. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #6
    The left div is too wide for its space and is pushing the content div out of the way.
    Removing the width from the left div fixes it in Firefox but I didn't test in other browsers.
    
    div.left
    {
    float:left;
    [s]width:98px;[/s]
    margin:0;
    padding:1em;
    }
    
    Code (markup):
    You could also fix it by increasing the margin-left value for the content div but that causes other problems.
     
    Last edited: Dec 10, 2010
    Cash Nebula, Dec 10, 2010 IP
    toretic likes this.
  7. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #7
    Tables can create massive problems, yes.

    A layout with 2 or 3 columns can be easily done with CSS, fixed, fluid, whatever you need.
    It is easier to maintain, easier to modify, easier to code!

    CSS is the way to go for site layout :)

    Check http://www.csszengarden.com/ ... choose another design on the right.

    The HTML markup is NOT changed, only the CSS is changed.
     
    CSM, Dec 10, 2010 IP
  8. toretic

    toretic Peon

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Thanks @Cash Nebula, you kinda solved my problem, and now i know why i had another problem ;). +rep
    @CSM, i am aware that tables can cause problems, but the problem in my case is not coming from the tables i have on my site. The tables wont be there forever i will remove them after i am done with the thing i do now.
    Thanks for the link thou, i am thinking of buying the book from this site for a long time now.
     
    toretic, Dec 11, 2010 IP
  9. Cash Nebula

    Cash Nebula Peon

    Messages:
    1,197
    Likes Received:
    67
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks for the rep :)

    To expand the parent container so it fits the floated containers inside it, add overflow: hidden; to the parent container.
    Sitepoint - Simple Clearing of Floats
    Getting DIVS to Expand Vertically

    
    div.content
    {
    margin-left:115px;
    border-left:1px solid gray;
    padding:1em;
    min-height:250px;
    background-color:#fff;
    [COLOR="blue"]overflow: hidden;[/COLOR]
    }
    
    Code (markup):
     
    Cash Nebula, Dec 11, 2010 IP
  10. toretic

    toretic Peon

    Messages:
    155
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #10
    THANKS A LOT!
    You really helped me out. I wish i could give you rep once more!
     
    toretic, Dec 11, 2010 IP
  11. CSM

    CSM Active Member

    Messages:
    1,047
    Likes Received:
    25
    Best Answers:
    0
    Trophy Points:
    55
    #11
    Good job Cash.

    I am sick of fixing other people's CSS problems at the moment.
    Have to fix my own sites first (time pressure).
     
    CSM, Dec 12, 2010 IP