+ Reply to Thread
Results 1 to 10 of 10

Thread: proper positioning

  1. #1
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486

    proper positioning

    i need some help, i am currently working on something that drives me crazy.

    ok, i have a fixed-width website. within the content wrapper there is an image

    HTML Code:
    <div class="content-wrapper">
      <div id="image">
        <a href="<?php echo htmlspecialchars(getFullImageURL()); ?>" title="[php]<?php echo getBareImageTitle(); ?>[/php]">
          <strong><?php printDefaultSizedImage(getImageTitle()); ?></strong>
        </a>
        <div class="imgnav">
          <?php if (hasPrevImage()) { ?>
          <div class="imgprevious">
            <a href="<?php echo htmlspecialchars(getPrevImageURL());?>" title="<?php echo gettext("Previous Image"); ?>">
          &laquo; <?php echo gettext("prev"); ?>
            </a>
          </div>
          <?php } if (hasNextImage()) { ?>
          <div class="imgnext">
            <a href="<?php echo htmlspecialchars(getNextImageURL());?>" title="<?php echo gettext("Next Image"); ?>">
              <?php echo gettext("next"); ?> &raquo;
            </a>
          </div>
          <?php } ?>
          <div class="clear"></div>
        </div>
      </div>
    </div>
    so i have an image-wrapper (#image), within the wrapper i have a dynamic image an beneath the image there is a pager (previous and next).

    the thing is i would like to have the next-button floated on the right and the previous-button floated on the left aligned with the image. the image is dynamic so i can be landscape or portrait.

    how do i css this properly, so the buttons are always aligned with the edges of the image regardless its width?


    thanks in advance


  2. #2
    Mr. Tambourine Man LeadMagnet's Avatar
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    2,863
    give your #image a relative or absolute positioning, then do the same for the next and previous buttons. You can position your next button 0px from the right edge of #image and the previous button 0px from the left edge of #image
    Subtlety is my middle name... and first and last in case you didn't get the point.
    http://www.eoingriffin.com

  3. #3
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,879
    That might not work Eion, but this does:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />	
    	<meta name="robots" content= "ALL" />
    	<meta name="description" content= "Semantic web development, web standards, CSS Wizardry and other stuff." />
    	<meta name="keywords" content= "web standards, semantics, accessibility, typography, web developer, CSS, xHTML, Harry Roberts" />
    	<meta name="author" content= "Harry Roberts" />
    	<title>Image pagination</title>
    	<link rel="shortcut icon" href="http://csswizardry.com/favicon.ico" />
    	<style type="text/css">
    		#gallery	{ margin:0 auto; float:left; border:1px solid #0f0;}
    		#image	{ width:500px; display:block; }
    		#previmg	{float:left;}
    		#nextimg	{float:right;}
    	</style>
    </head>
    <body id="home">
    
    	<div id="wrapper">
    		<div id="gallery">
    			<img src="http://www.estetica-design-forum.com/images/test-image-one.jpg" alt="image" id="image" />
    			<img src="http://www.estetica-design-forum.com/images/prev.jpg" alt="Previous image" id="previmg" />
    			<img src="http://www.estetica-design-forum.com/images/next.jpg" alt="Next image" id="nextimg" />
    		</div>
    	</div>
    
    </body>
    </html>
    EDIT: Only tested in FF.

  4. #4
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486
    ok thanks, i will try it and will let you know which one worked out. thanks

  5. #5
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486
    small update from my side:

    harry's solution is working in ff, opera and safari, but it won't work in ie.
    many thanks for that, because i never would have come up with this .
    i'm going to try eion's solution with conditional comments on ie and hope it is going to work.
    thanks a lot.

  6. #6
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486
    another update: eoin's solution worked on ie, but now i am faced with another problem.

    position:relative didn't worked, position:absolute did work. as the image incl. the pagers have an absolute position, they were taken out of the layout-flow and so the holding container won't resize to its content.

    i know there were solutions out there, but i cannot find them on the net. maybe someone can help out.


    edit: this applies to ie6 and ie7. ie8 manages to render the layout like ff, opera and safari. damn, i hate ie!
    Last edited by bartoszdesign; 28-03-2009 at 02:29 PM.

  7. #7
    CSS Wizardry Harry's Avatar
    Join Date
    May 2007
    Location
    Leeds, England
    Posts
    13,879
    The trick is making the container hug the left and right of the image. If you can find a way of doing that then you've won.

  8. #8
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486
    huh? hehe ok, well. most solutions/fixes are for floating elements, which are not absolute.
    is there a fix for this at all, or is it just easier to find another solution to position the pagers in ie7? the dirty solution would be using javascript resizing the container to the height of its children.

  9. #9
    Mr. Tambourine Man LeadMagnet's Avatar
    Join Date
    Jun 2007
    Location
    Ireland
    Posts
    2,863
    Can you post up some sample page for us to mess with to see what you're trying to do (without the php. I cba going through that)
    Subtlety is my middle name... and first and last in case you didn't get the point.
    http://www.eoingriffin.com

  10. #10
    Established Member bartoszdesign's Avatar
    Join Date
    Aug 2008
    Location
    The Netherlands
    Posts
    486
    Fotoalbum|Reeshof Podium| reeshof-podium-001|www.reeshoftotaal.nl

    this is were it should happen... i have set a fixed wrapper height in ie7 for now as i haven't found a solution yet. i am looking for a solution in ie7, i won't support ie6 anymore.

    thanks

+ Reply to Thread

Similar Threads

  1. subnavigation not working proper in IE
    By nisha in forum CSS Forum
    Replies: 0
    Last Post: 25-10-2008, 09:02 AM
  2. Proper Sub Woofer Speaker System
    By lamploi79 in forum Music
    Replies: 0
    Last Post: 09-07-2008, 10:52 AM
  3. Proper web design
    By next in forum Graphic Design and Web Design Help
    Replies: 16
    Last Post: 09-06-2008, 10:08 AM
  4. using and positioning <div></div>
    By philjohns in forum CSS Forum
    Replies: 4
    Last Post: 05-12-2007, 07:34 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts


The Graphics Forum Web Design Stuff Free Decent Downloads Free Quality Wallpapers Graphics Forum Free Vista Themes
The Top The Best Images Tech Talk 247 Logo Design - $149 Affordable Stock Vector Illustrations Creativecurio - Design Blog Graphic Design Advertising

Check the forum often for the latest design announcements. Everything from graphic design and web design, to films and music. Estetica is a great place for people to get together and help each other out.



Web Hosting - UK Web Hosting services for business or personal website hosting needs.

Dedicated Servers - A full range of Managed Dedicated Server solutions suitable for all your requirements.

Graphic Design Blog | Web Design Forum | Graphic Design and Print Forum | Graphic Design Links | Advertise On This Site

Web Design UK | Vision.To Design | Leaflet Printing | Estetica Design Forum's Privacy Policy

Flyer Printing | Photography Blog | Design Forum Links | Logo Design | Graphic Design Social Network | Logo Design

Graphic Design Tutorials | Logo Designer | UK Logo Design Studio | Land for sale | Vector Art Blog | Leaflet Printing

Free Web Hosting | Custom Logo Design - $149 Only | Affordable Print Design Templates | Small Business Logo Design | Company Logo Design

Logo Design Service | Logo Design Firm | Logo Design Reseller | Custom Logo Design | Letterhead Printing | Flyer Printing | Business Card Printing

Printing | Leaflet Printing | Online Backup | T-Shirt Printing | Personalised Mugs | Canvas Printing | Free Web Hosting Comparison Site