Forums

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

Home Forums CSS Floats problem

  • This topic is empty.
Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #42311
    bastunqk
    Participant

    Hello to everybody. Great forum.
    Could you please help me to understand whats happening with this container.
    I have container with id whole in this container i have two other divs with id leftReoportaji and rightReportaji and in them i have two spans which holds the video and the text.Video is also floated to left.
    Here is my CSS

    #leftReoportaji {
    padding: 0;
    width: 50%;
    float:left;
    border-right: 3px solid black;

    }

    #rightReportaji {
    padding: 0;
    width: 48%;
    float: right;
    }
    /*Inner video*/
    #allVideo {
    float: left;
    clear: both;
    padding: 5px;
    }

    #wholee {
    border: 3px solid black;
    }
    The problem is that the right div is not equal to left. HR is moved. Here is an image to see it.
    prob10.png

    Thanks in advance.

    #122548
    Kitty Giraudel
    Participant

    Could please make a codepen.io or a jsfiddle.net? It’s hard to help you without being to play around with the code.

    However I suspect some box-model issue.

    #122549
    Paulie_D
    Member

    > I suspect some box-model issue.

    Ditto…plus he’s mixing % and px.

    #122542
    Kitty Giraudel
    Participant

    Without either border-box box-model or calc(). We’ll determine once we get to see the code.

    #122551
    bastunqk
    Participant

    Here it is the basic html:


    Video is here
    text text text


    Video is here
    text text text



    and the css:

    #leftReoportaji {
    padding: 0;
    width: 50%;
    float:left;
    border-right: 3px solid black;

    }

    #rightReportaji {
    padding: 0;
    width: 48%;
    float: right;
    }
    /*Inner video*/
    .allVideo {
    float: left;
    clear: both;
    padding: 5px;
    }

    #wholee {
    border: 3px solid black;
    }

    .clearfixx:after {
    content: “.”;
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
    }

    #122552
    Kitty Giraudel
    Participant

    Please make a JSFiddle or a CodePen.

    #122554
    wolfcry911
    Participant

    You still haven’t give near enough information…

    The float heights seem to be derived from the amount of text. Notice the right float has one more line of text (probably because it’s 2% smaller in width than the left float). I’m guessing there’s a bottom padding or margin on the text span, or link…

    #122555
    bastunqk
    Participant
    #122556
    Paulie_D
    Member

    Yes, we understand but we don’t know the size of the video.

    However, I do think you have structured this rather badly. I wouldn’t be using spans at all.

    #122557
    Kitty Giraudel
    Participant

    > However, I do think you have structured this rather badly. I wouldn’t be using spans at all.

    Same here.

    #122558
    Paulie_D
    Member

    You also seem to have an ID for your left side and class for your right side….Ick!

    #122559
    maxisix
    Participant

    is it what you want http://cl.ly/image/3q2a1U2F2M1M ?

    #122560
    maxisix
    Participant

    He’s right !
    > However, I do think you have structured this rather badly. I wouldn’t be using spans at all.

    #122561
    bastunqk
    Participant

    The spans was the problem. Thanks to everybody.

    #122562
    wolfcry911
    Participant

    I agree with Hugo and Paulie – not structured very well. Your pen doesn’t even closely resemble the problem in the pic. How are we to help if you won’t give us information? Why are you using the clearfix on everything?

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