Forums

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

Home Forums Design [SOLVED] Floating problem

  • This topic is empty.
Viewing 6 posts - 16 through 21 (of 21 total)
  • Author
    Posts
  • #253530
    s_cristina
    Participant

    hello, it’s me.. again..

    I just realised now that the layout on bigger screens doesn’t look like i thought.

    i would like that the text sticks to the right side and that it is in a container. Like here. But this example doesn’t break and doesn’t go to the other below, like I would like to have.

    #253542
    Atelierbram
    Participant

    Don’t know exactly what you mean with:

    that the text sticks to the right side and that it is in a container.

    The text in the demo is in a container (like all in HTML really; everything is a “rectangle/box”). Can give it background-color and padding, but I don’t know …

    So what have you tried? Can you show what you have tried so far in a demo?

    #253544
    s_cristina
    Participant

    I tried this but if it breaks and goes under the picture, it goes over the left alignment of the picture above.

    #253545
    Atelierbram
    Participant

    I reduced my fork of your former demo a bit further, with the added .textcontainer from your last demo. The way your last demo is trying to achieve this right alignment of the .textcontainer is with absolute positioning. Now this is tricky for the main reason it takes the element out of the “normal flow“. This is what you found out with the overlapping [1]. With floating this .textcontainer to the right, with a value for max-width applied to it, we can achieve the same. Note however that this is not the only way to achieve this: another (and maybe better) way would be using flexbox, but it can’t hurt learning using floats first. Note also I out-commented the so-called clearfix, because with “overflow: hidden” on the direct parent element of the floated element, we don’t need this clearfix here, but it would have achieved the same effect: clearing the floats.

    http://codepen.io/atelierbram/pen/OpKXQo

    Let us know if this comes closer to what you want.

    1. Note that an absolute positioned element is always positioned in relation to the first parent element which has position: relative applied to it.
    #253577
    s_cristina
    Participant

    Thanks a lot!!!!!
    Now i just have to put this kind of responsive in bigger screens but I think I can solve this somehow. I guess it will work If I do with the @media query.
    Well I will try first.

    #253579
    s_cristina
    Participant

    Okey this page works now fine!

    Now is just the masonry gallery the problem.. After this I have all settled down to go online.

    Thanks again!

Viewing 6 posts - 16 through 21 (of 21 total)
  • The forum ‘Design’ is closed to new topics and replies.