Forums

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

Home Forums CSS Is It Possible to Do This with CSS?

  • This topic is empty.
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #40892
    realph
    Participant

    So I wanted to know if it’s possible to do this. Basically, I’ve got my #wrapper set to margin: 0 auto, but want all imgs that are already within a #content div to extend their width until the edge of the browser. Like so:

    Here’s a jsFiddle I setup to try and replicate my idea: http://jsfiddle.net/W7p3K/45/

    Any idea if this is possible? Thanks in advance.

    #114930
    Paulie_D
    Member

    You mean like this?

    http://jsfiddle.net/hL43A/

    Clearly an image can’t break out of it’s container though.

    #114932
    realph
    Participant

    Yeah, I wanted the wrapper to stay put though.

    #114933
    Paulie_D
    Member

    Then “No”. Either it’s in the wrapper or it isn’t.

    You might be able to position it absolutely though…not sure how that would scale.

    #114937
    Paulie_D
    Member

    Yeah,,,having the image scale sort of defeat the point of having a wrapper.

    Why not just take it out of the content?

    http://codepen.io/anon/pen/KaewC

    #114947
    realph
    Participant

    @Paulie_D That’s pretty much what I’m looking, except with a wrapper that keeps the rest of the content (sans the images) centered. Know of a way around that?

    #114949
    Paulie_D
    Member

    Nope.

    #115679
    realph
    Participant
    #115704
    Schwarttzy
    Member

    I can do this give me a second.

    #115705
    Schwarttzy
    Member

    Woot! I thought I might have opened my mouth to soon but I got it. Link -> [http://codepen.io/anon/pen/hIpyE](http://codepen.io/anon/pen/hIpyEhttp://codepen.io/anon/pen/hIpyE”)

    #115965
    realph
    Participant

    @Schwarttzy Fantastic solution! But do you know a way of keeping the container a fixed width? i.e. 960px

    #116090
    Schwarttzy
    Member

    Sorry not possible, the image is dependent on that width. I suggest you forget about 960px… and look into percentages because they work much better.

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