Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

how to make an image's width the whole screen?


  • Please log in to reply

#1
TaNkZ101

TaNkZ101

    Member

  • Member
  • PipPipPip
  • 327 posts
i have an image called line.gif, it's 1x4 (4 verticle, 1 horizontal, this saves file space immensley as opposed to e.g. 1024x4) pixels. normally i'd put it's width at 999px (1000 activates the horizontal scroll which i don't want) to fit the width of an IE browser. but since i want my site to take up the whole browser width of ANY resolution, i converted all my measurements to percents, except for this one. when i put the image width 100%, it's only 1 px wide. if i put it in a div and the div at 100%, same effect. anybody have any ideas?

mind you this is for INTERNET EXPLORER, later i'll make the css's compatible to other browsers, but i.e. is still the most popular browser (unfortunately).
  • 0

Advertisements


#2
knexor2

knexor2

    Member

  • Member
  • PipPip
  • 28 posts
I was beginning to wonder if you were using stylesheets or not :whistling:

I think using style="width:100%" in the img tag should work, but a good alternative is to make your img the background img of a width:100% div, thusly:

[codebox]

<style type="text/css">
#superpic {background:url(/url/to/pic.wev); width:100%; height:4px; font-size:1px}
</style>

<div id="superpic"></div>

[/codebox]

If you want to put text in the div (links, for example, like a sidebar), you will have to change the font-size to an acceptable size.

Also, just a comment on your previous method, bear in mind that users can resize their windows, thus making the fixed width of your stuff irrelevant.
  • 0

#3
TaNkZ101

TaNkZ101

    Member

  • Topic Starter
  • Member
  • PipPipPip
  • 327 posts
ahh yes i didn't remember the background of a div. width:100% makes the image 100% of it's size, not the screen unfortunately.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP