Results 1 to 7 of 7

Thread: Absolute positioning text

  1. #1
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Absolute positioning text

    Can anyone provide me with a code for absolute positioning of text? Thanks

  2. #2
    Join Date
    Dec 2004
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    absolute? like <center> but on side? where do you want to position it?

  3. #3
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    well there's an absolute position code for positioning images or other things by the number of pixels from the left and top, but it doesn't seem to work for text, is there a way to get text positioned that way?

  4. #4
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Black Roses Burn Brightly
    well there's an absolute position code for positioning images or other things
    These are all elements, and the only things that can be addressed through CSS selectors. That is, you don't position an image, but you do position an img element. Likewise, you can't position text, but you can position an element which contains text, such as a p or span element.

    by the number of pixels from the left and top
    There are a variety of units that can be used for positioning, not just pixels. Similarly, elements can be offset from the right or bottom, or may not involve offsets at all (in the case of floats).

    but it doesn't seem to work for text
    Do you mind showing an example of what you're trying to do, and perhaps what you've tried so far?

    Mike

  5. #5
    Join Date
    May 2005
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Well I don't exactly have an example because I can't seem to get it working, but I can explain to you in a simple way what I am trying to do...I have a row of pictures that are linking to pages, and I want a link to be under each picture, but I can't find a way to do that, and another row of pictures to start a few spaces below the links...I can do that part, I'm just telling you what I'm trying to do...So basically I just need to get some text under some pictures, that's the simplest way I can put it. Thanks.

  6. #6
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2,358
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Black Roses Burn Brightly
    Well I don't exactly have an example because I can't seem to get it working
    I wasn't looking for a working example (you wouldn't be asking for help if you had one ), but posting (preferably a link to) something can identify misconceptions that you might have. Moreover, it can be simpler to alter an existing example rather than writing something from scratch.

    I have a row of pictures that are linking to pages, and I want a link to be under each picture [...]
    So you're referring to captions? You should be able to find examples in various places, but it's not that complex. All you need to do is use a container to group each image/caption pair. When you want to position these groups, you do it with respect to the container, not the image or the text.

    HTML Code:
    <div class="image-container">
    <img alt="" src="...">
    <p>Your caption.</p>
    </div>
    You can then style these containers, and their content, as you see fit. How you position them is up to you, but floating them is probably best.

    If you want a more complete example, I'd need some sample content. It's a bit difficult to demonstrate a layout when I don't know what I'm laying out.

    Mike

  7. #7
    Join Date
    May 2005
    Location
    Iowa
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    If your heart isn't set on learning CSS to do pixel-level positioning, it's faster and easier to lay your pictures out in a table. You can place the image in a <td>, then use <br> to drop beneath the picture to enter its caption. For best results, use the height and width attributes to keep your pictures uniform and keep the table nice and neat.

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
  •