Forums

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

Home Forums CSS Responsive Box Centered with Image Right and Text Left

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #164067
    wismile
    Participant

    My goal is to create a box with a 50% width, border and drop shadow. The box should be fully responsive and include an image on the right that uses 50% of the width and is flush top, right and bottom. On the left half I would like to have text that is aligned right.

    Here’s what I have so far…

    http://cdpn.io/iAhsd

    I’m new here and obviously a novice!

    This website looks like a great place to learn the proper way to accomplish my goals.

    Thanks for your help!

    #164070
    Paulie_D
    Member
    #164071
    wismile
    Participant

    very close…THANKS!

    I can adjust the padding, but the drop shadow is gone on yours.

    I’m trying to understand all this, so I have a question about what you did.

    Every combination of “Float” I tried caused the border to collapse.

    Was that problem fixed with this CSS code?…

    img { display: block; }

    #164072
    Paulie_D
    Member

    Box-shadow should be back now.

    If you float all the items in a container it will collapse.

    There are a number of ways to fix this, I chose the simple and quick one overflow:hidden. It’s called a ‘clearfix` so you can look into other methods.

    #164073
    wismile
    Participant

    Fabulous Paulie_D…Thanks for your help!

    I can’t wait for the day someone invents a way to upload this type of knowledge directly into my aging brain cells.

    In the meantime it’s nice to find a place with friendly knowledgeable people willing to share.

    #164074
    Paulie_D
    Member

    Happy to help.

    #245977
    servlet
    Participant

    Hello

    Nice trick!

    Paulie_D what will be the code if we have 4 images with 3-4 paragraphs?

    I did some test but there is no success.

    #245983
    Paulie_D
    Member

    If you start a NEW question with YOUR code (ideally in a Codepen.io demo) we can take a look.

    It’d be helpful if you also had an image of what look you are trying to achieve and what relationship the pictures have to the text.

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