Forums

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

Home Forums CSS force width of an element

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #35937
    dynamyc
    Member

    I have a image for example with a width of 980px.
    I have a container div of 980px and inside it a content div of 900px.
    I put the image in the content div like this :

    img {
    position: absolute;
    top: 528px;
    display: block;
    width: 980px !important;
    left: 0px;
    }

    And it’s working, but I’m wondering if it’s possible to use position:relative for example or other method instead of using position:absolute.

    P.S Don’t tell me to put it in the container div :)

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