Webforumz's RSS FeedRSS Webforumz RegistrationRegister Contact Webforumz StaffContact

postioning an image

This is a discussion on "postioning an image" within the Web Page Design section. This forum, and the thread "postioning an image are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 25th, 2008, 16:42
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
postioning an image

Hi

Im new to CSS and have started building a webpage.

I want an image (gradient) to display at the very top of the page, and stretch across the whole page, even if a browser expands.

I think its to do with ems, but im not sure which values etc to enter.

The size of the image is: 1000w and 20h.

Hope you can help....its driving me bonkers
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2  
Old Jun 25th, 2008, 17:27
Junior Member
Join Date: Mar 2008
Location: Lisburn, Northern Ireland
Age: 28
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

Assuming your image is an image that has a pattern and you want it repeated (stretching can distort an image) may I suggest:

.myPageHeader {
background: url(myImageFile.jpg) repeat-x 0 100%
}

where myImage is the class found in your page representing the top of your page, and myImageFile.jpg is the path to the file itself.

repeat will repeat an image horizontially and vertically. Repeat-x is horizontal and repeat-y is vertical only. No-repeat will display the image once.

I hope this helps you.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 26th, 2008, 10:58
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: postioning an image

Could you provide a link to your site?

Also, if the image is pretty simply, cut it down the the least amount of pixels wide, this will reduce loading time.

Eg, if you have a simple gradient, what a lot of people do is to reduce the image to 1px wide, as repeating this image would have the same affect as repeating the same image 100px wide, it would just be 100 times quicker to load.
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 26th, 2008, 11:13
Reputable Member
Join Date: Mar 2008
Location: Chester, UK
Age: 18
Posts: 465
Thanks: 2
Thanked 33 Times in 33 Posts
Re: postioning an image

if it's 1000px wide, i'd guess he'd be repeating it vertically... in which case it's repeat-y

Easy to remember mind, because X is a cross

yeah you'd only need 1px times however much.

If you want to repeat it horizontally it would need to be xamount height, and 1 px width, or the other way for vertical (for gradients anyway, and assuming it's a linear gradient.)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5  
Old Jun 26th, 2008, 11:17
unitedcraig's Avatar
SuperMember

SuperMember
Join Date: Oct 2007
Location: Stockport
Age: 17
Posts: 844
Blog Entries: 1
Thanks: 0
Thanked 1 Time in 1 Post
Re: postioning an image

As all images are different, best thing to do would be give us a link to your site so we can see exactly what it is you are trying to do
__________________
Last Blog Entry: A Royal Mistake (Feb 20th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6  
Old Jun 27th, 2008, 13:01
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

Hay thanks!

Sorry for not being specific.

I have a graident background which im repeating, however I would like a strip of colour (which is also a graident)to sit at the top of the browser. I also want it to stretch and re-size as the user makes the browser bigger or smaller.

So what im gonna try now is to add this image to the divtag which holds the repeating image, and try to get the CSS rule to make it elastic.....
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7  
Old Jun 27th, 2008, 13:12
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

didnt work.

So what I want to do is have an image and apply a CSS rule to it, wrap a divtage round it. Then the image should stretch as the browser re-sizes.

Last edited by Tommyttt; Jun 27th, 2008 at 14:15.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #8  
Old Jun 27th, 2008, 13:42
Junior Member
Join Date: Mar 2008
Location: Lisburn, Northern Ireland
Age: 28
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

Have you got a sample of the gradient image? If we can see what you have to work with we might have a better idea of what it is you want to try. You have host it on image shack or some other image sharing site.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #9  
Old Jun 27th, 2008, 14:40
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

Its just a gradient, yellow to blue.

The location of the image in the code:

</head>

<body class="twoColFixLtHdr">

<div id="topGradient"><img src="top_gradient.jpg" width="1024" height="10" /></div>
<div id="container">
<div id="header">
<h1>Header</h1>
<!-- end #header -->
</div>
<div id="sidebar1">
<h3>Sidebar1 Content</h3>

Heres the CSS rule for that divtag that is wrapped around the image.

.twoColFixLtHdr #topGradient {
float: left;
height: 10px;

}

any ideas?????????????
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #10  
Old Jun 27th, 2008, 14:42
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

http://www.zune.net/en-US/

PS This is the effect that I want.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #11  
Old Jun 27th, 2008, 15:15
Junior Member
Join Date: Jan 2008
Location: London
Age: 27
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Re: postioning an image

I found a way to do it.

Turn off the horizontal scrolling bar!! WOOOooooHHOOOoooo

Oh dear....exicted about Dreamweaver...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #12  
Old Jun 27th, 2008, 15:51
Elite Veteran
Join Date: Aug 2005
Location: That Place
Posts: 2,044
Blog Entries: 1
Thanks: 0
Thanked 37 Times in 37 Posts
Re: postioning an image

Quote:
Originally Posted by Tommyttt View Post
I found a way to do it.

Turn off the horizontal scrolling bar!! WOOOooooHHOOOoooo

Oh dear....exicted about Dreamweaver...
Oh no, not good.

All you need to do is make a graphic of your gradient and set the body {} in your css to something like

body {background:#CCCCCC url(../images/foo.jpg) repeat-x left top;}

setting the color value "#CCCCCC" to the solid color your gradient image ends in.
Last Blog Entry: Apps every Mac based web dev should consider (Jul 10th, 2008)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Postioning orange boxes to left of page Johnathan Web Page Design 15 Feb 18th, 2008 23:23
[SOLVED] multiple image rollover not restoring image snappy JavaScript Forum 4 Nov 5th, 2007 15:38
Image gallery not displaying enlarged image AdRock PHP Forum 15 Sep 1st, 2006 12:31
Background image overlaping footer image at bottom of div lw_d Web Page Design 4 Mar 21st, 2006 01:27
how can i create a wireframe image from a solid image of som benbacardi Graphics and 3D 5 May 22nd, 2004 12:05


All times are GMT. The time now is 19:19.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8