SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Right justifying divs

    Is there a way to do this? For some reason, since I have fluid content on the left side, relative positioning isn't working. Although, the left content is no where near the right content, it still moves with the left content.

  2. #2
    Forums Designer
    Join Date
    Jun 2004
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try float: right

  3. #3
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,285
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    If float doesn't cure your problem then post some code (or a link) so we can see what you are trying to do

    paul

  4. #4
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've heard bad things about floats, so I'll post the code just in case someone knows the answer. It's basically 2 divs within a div. One is a site directory script, the other, a search form.

    Code:
    <div id="subheader">
    		<div id="directory">
    
    		<p><a href='/'>home</a> &gt; index.php</p>		</div>
    		<div id="search">
    		<form name="f_search" method="get" action="tsep/tsepsearch.php">
    		    <input type="hidden" name="s" value="0">
    		    <input type="hidden" name="e" value="10">
    		    <input type="text" name="q">
                        <input name="search" type="submit" value="Search">
    	  	</form>
    		</div>
    </div>

  5. #5
    Forums Designer
    Join Date
    Jun 2004
    Posts
    422
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think float is best solution for your problem. It causes problems only when you have fixed width of all divs, but in this case few pixels added by IE won't cause any problems at all so floats would work without any problems.

  6. #6
    SitePoint Wizard subnet_rx's Avatar
    Join Date
    Aug 2001
    Location
    Hattiesburg, MS
    Posts
    1,085
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, in my case, adding float:right to my CSS just makes it add an extra line, then float it right. As if it doesn't realize the width of the search box and thinks it needs to lines.

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,285
    Mentioned
    179 Post(s)
    Tagged
    6 Thread(s)
    HI,

    Remember when you float someting alondise somethng else then the float must come first in the html.

    e.g.
    Code:
    <div id="subheader">
      <div id="directory">
      <div id="search" style="float:right;width:220px">
      <form name="f_search" method="get" action="tsep/tsepsearch.php">
    	  <input type="hidden" name="s" value="0">
    	  <input type="hidden" name="e" value="10">
    	  <input type="text" name="q">
    					<input name="search" type="submit" value="Search">
    	</form>
      </div>
      <p><a href='/'>home</a> &gt; index.php</p>  </div>
    </div>
    Inline style for example only

    Paul


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
  •