Can anyone provide me with a code for absolute positioning of text? Thanks![]()
Can anyone provide me with a code for absolute positioning of text? Thanks![]()
absolute? like <center> but on side? where do you want to position it?
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?
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.Originally Posted by Black Roses Burn Brightly
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).by the number of pixels from the left and top
Do you mind showing an example of what you're trying to do, and perhaps what you've tried so far?but it doesn't seem to work for text
Mike
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.
I wasn't looking for a working example (you wouldn't be asking for help if you had oneOriginally Posted by Black Roses Burn Brightly
), 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.
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.I have a row of pictures that are linking to pages, and I want a link to be under each picture [...]
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.HTML Code:<div class="image-container"> <img alt="" src="..."> <p>Your caption.</p> </div>
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
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