Advanced Search

Results 1 to 8 of 8

Thread: How to make something float on a page?

  1. #1
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default How to make something float on a page?

    hi guys, today i want to ask again, let say i have a website and the front page is index.htm

    now i have some image and i want to make it float on the index.htm on the left side, how can i do this?

    thank you before guys

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    Give style:
    Code:
    <img style="float:left" src="images/img1.jpg" title="myimage" />
    Or give class:
    CSS

    Code:
    <style>
    .myimage{
    float:left;
    }
    </style>
    HTML

    Code:
    <img src="myimage.jpg" title="myimage" class="myimage"/>

  3. #3
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    sorry but i tried and it didnt work, what i mean by float is when we scroll down the page the image follows to scroll down,its called floating right? sorry if i got the wrong name for it,,

    but thanks before for the answer

  4. #4
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    Sorry, i thought css float ><

  5. #5
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,627
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    you mean you want the element to always stay in the same place in the browser window? Use css (for example, this div will always stay in the top left corner of the screen):

    Code:
    <div style="position: fixed; top: 0px; left: 0px">
    </div>
    We Only Torture the Folks We Don't Like (You're Probably Gonna Be Okay)
    It's a Party in the CIA

  6. The Following User Says Thank You to traq For This Useful Post:

    k12onos (07-06-2008)

  7. #6
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    what if i want to make it at the bottom of the page? i mean everyone's screen is in different size, so how do i make it always in bottom?

  8. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,702
    Thanks
    43
    Thanked 3,133 Times in 3,097 Posts
    Blog Entries
    12

    Default

    Code:
    <div style="position: fixed; bottom: 10px; left: 0px">
    </div>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  9. The Following User Says Thank You to jscheuer1 For This Useful Post:

    k12onos (07-06-2008)

  10. #8
    Join Date
    Aug 2006
    Posts
    58
    Thanks
    14
    Thanked 0 Times in 0 Posts

    Default

    wow thanks a lot jscheuer1 !

    will try it right away

    thanks again!

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
  •