an element positioning question

This is a discussion on "an element positioning question" within the Web Page Design section. This forum, and the thread "an element positioning question 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 Dec 20th, 2007, 18:35
Junior Member
Join Date: Oct 2007
Location: Holland
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
an element positioning question

hello

I have a division with a small picture as a background with:

background-position: center left;

...so that the picture appears centered on the left in the division.

I also want to put a checkbox right under the background picture, and I guess I'll have to position it relative to the center of the division (because the division height is not always the same).

Is this possible?

Thank 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

  #2  
Old Dec 20th, 2007, 22:23
Highly Reputable Member
Join Date: Sep 2007
Age: 15
Posts: 717
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: an element positioning question

I'm not sure what you mean. Could you post a link?
Last Blog Entry: Windows Vista vs. Mac Leopard (Nov 4th, 2007)
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 Dec 20th, 2007, 23:07
Elite Veteran
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: an element positioning question

hmmmmm......Why would you position a background image center, left?

If you just had the div the same size as the image, you wouldn't need any positioning. That would make it much easier to align the checkmark.

Maybe a link as swagner said or more clarification is necessary.
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 Dec 21st, 2007, 00:56
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: an element positioning question

Just a side note, you're using "center left" incorrectly. It should be "left center" or you could use numbers to save a few bites.

Code: Select all
background-position: 0 50%;
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 Dec 21st, 2007, 08:02
Junior Member
Join Date: Oct 2007
Location: Holland
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Re: an element positioning question

I position it center left, because I need the picture there. Everything else is transparent background.

The div's heght is always different, depending on the length of the text content inside. That's why I cannot set the div size the same as the image... But I still have to find a way to position the checkbox right below the image.

If I was not clear enough, please let me know...
Thanks!
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 Dec 21st, 2007, 09:02
Ryan Fait's Avatar
Elite Veteran
Join Date: May 2006
Location: Las Vegas
Posts: 3,787
Thanks: 0
Thanked 0 Times in 0 Posts
Re: an element positioning question

You'll have to do it on an individual basis, I'm afraid. You could write up a script in PHP that would check the image size and add separate style tags to each div. CSS cannot do this, however.

And as for the "center left" thing, I mean it's an organizational error. Left and Right positioning comes before top and bottom. I.E., putting "center left" is not the correct order, "left center" is. The way you have it can cause issues in certain browsers.
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
How To Fix <TD> Element Size? ivan Web Page Design 6 Dec 11th, 2005 18:43
using params in xsl IF element zzqproject Other Programming Languages 0 Nov 21st, 2005 23:12
<img> element - positioning at center jswebdev Web Page Design 4 Sep 21st, 2005 17:49
Positioning Question Audioz Web Page Design 0 Dec 8th, 2004 14:57
XHTML Block Element in an Inline Element gohankid77 Web Page Design 6 Jul 27th, 2004 10:15


All times are GMT. The time now is 09:07.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42