ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Image Height in CSS Template

August 27, 2007 8:00am

Subscribe [2]
  • #1 / Aug 27, 2007 8:00am

    rick.prince

    111 posts

    I’ve made a custom text box field which I store a header URL image in and output it using the img tag eg:

    {header_url}

    I’d like to change this tag to a div and place the image as its background so for small resolutions users don’t get a horizontal scroll bar. eg:

    <div id="header"></div>

    and for the css template I’d put:

    #header {
    background: {header_url}
    height: ???
    }

    The thing is each header picture has different heights which I’d like to specify but don’t know how.

    Thanks!

  • #2 / Aug 27, 2007 9:41am

    Sue Crocker

    26054 posts

    You’d have to use GetImageSize with PHP in order to grab that information.

    You’d probably use PHP on output.

    Does that help?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases