Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Positioning help

  1. #1
    xadrieth is offline x10Hosting Member
    Join Date
    Apr 2009
    Posts
    62

    Positioning help

    Um, I'm trying to create a little "Welcome back USERNAME" bar at the top of my website.

    It looks like this right now:


    I don't want it like that because of that stupid padding, I want it to be glued right to the borders of the browser, like this:



    Any help on how to get it like this?

  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: Positioning help

    I don't fully understand... why not just get rid of the padding???

    Can you link us to the source?
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    xadrieth is offline x10Hosting Member
    Join Date
    Apr 2009
    Posts
    62

    Re: Positioning help

    Sure, but that padding is caused from the browser, and im not sure how to get rid of it.

    HTML Code:
    <div id="userbar">Hi There</div>
    It's declared right after the <body> tag.

    Code:
    #userbar
    { background-color: #C8C8C8;
    border-style: solid;
    border-color: #515151;
    border-top-width: 0px;
    border-right-width: 1px;;
    border-bottom-width: 2px;
    border-left-width: 1px; 
    
    padding: 3px;
    font-size: 12px;
    color: #010101; }
    Last edited by xadrieth; 07-08-2009 at 05:11 PM.

  4. #4
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore
    Join Date
    Sep 2007
    Posts
    221

    Re: Positioning help

    add this in your body tag,

    Code:
    margin:0;
    padding:0;
    "Sanity is nothing but our interpretation of reality"

    http://tswebvisions.com - Portfolio

  5. #5
    xadrieth is offline x10Hosting Member
    Join Date
    Apr 2009
    Posts
    62

    Re: Positioning help

    Quote Originally Posted by sourfacedcyclop View Post
    add this in your body tag,

    Code:
    margin:0;
    padding:0;
    Problem fixed, thank you so much.

    EDIT:
    New problem.

    I'm having some more positioning problems.

    I added this code:
    HTML Code:
    <div id="panel"><span style="float: left;">Hi There</span><span style="float: right;">Time is Hammer Time</span></div>
    And it looks like this:


    And it shouldn't.

    How would I get the text to appear in the DIV with the SPANS sending the text to the left/right
    Last edited by xadrieth; 07-08-2009 at 07:48 PM.

  6. #6
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore
    Join Date
    Sep 2007
    Posts
    221

    Re: Positioning help

    Can you give a link to your site?
    "Sanity is nothing but our interpretation of reality"

    http://tswebvisions.com - Portfolio

  7. #7
    xadrieth is offline x10Hosting Member
    Join Date
    Apr 2009
    Posts
    62

    Re: Positioning help

    Quote Originally Posted by sourfacedcyclop View Post
    Can you give a link to your site?
    I'm testing it right now on XAMPP.

    If you want to see what I am trying to achieve with the DIVS and SPANS, take a look at http://twewy-fan.com/forum/, where it asks for a login.

    Where it asks for the Login info, it uses the DIV with SPANS that I want, the test to b aligned to the right/left on the same line.

  8. #8
    sourfacedcyclop's Avatar
    sourfacedcyclop is offline x10 Sophmore
    Join Date
    Sep 2007
    Posts
    221

    Re: Positioning help

    Hmmm... Its really hard to address without seeing it, but you could try this

    Code:
    <div id="panel"><span style="text-align:left;">Hi There</span><span style="text-align:right;">Time is Hammer Time</span></div>
    "Sanity is nothing but our interpretation of reality"

    http://tswebvisions.com - Portfolio

  9. #9
    xadrieth is offline x10Hosting Member
    Join Date
    Apr 2009
    Posts
    62

    Re: Positioning help

    Nah, that didn't work, it just smushed the text right together on the left.

    EDIT:
    Figured out a quick fix.

    Added:
    padding-bottem: 20px;

    To the ID of "panel"
    Last edited by xadrieth; 07-08-2009 at 09:34 PM.

  10. #10
    misson is offline x10 Spammer
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,573

    Re: Positioning help

    To get #panel to contain floats, use #panel { overflow: auto; }. Explicitly altering the height is brittle and will break if the font size changes or if the text ever takes up more than one line.

    To get more prompt help, include a link to a live version of your minimal test case.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Jon Skeet's and Eric Raymond's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

Page 1 of 2 12 LastLast

Similar Threads

  1. help with positioning
    By dellerdynamics in forum Scripts, 3rd Party Apps, and Programming
    Replies: 2
    Last Post: 12-15-2008, 11:03 AM
  2. CSS Positioning Help
    By Ainokea in forum Scripts, 3rd Party Apps, and Programming
    Replies: 10
    Last Post: 11-06-2008, 05:05 AM
  3. CSS positioning woes.
    By Farenvin in forum Scripts, 3rd Party Apps, and Programming
    Replies: 9
    Last Post: 04-19-2008, 09:16 PM
  4. positioning ads in Coppermine
    By dylan in forum Free Hosting
    Replies: 6
    Last Post: 11-03-2005, 12:43 PM

Posting Permissions

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