CSS Positioning

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Corrosive

Thread Starter
Joined
Jan 9, 2003
Messages
1,058
I'm a recent convertee to CSS positioning from tables for layout but I have two problems with the site I'm working on.

Firstly, does anyone know how to get text in a <DIV> tag to wrap when it reaches the width defined in the stylesheet? Having it get clipped off is really annoying me now and chucking in loads of <BR>'s seems to add to the problems the technology was meant to alleviate. :rolleyes:

And also, is there anyway I can get something to remain in the same place even if the resolution changes? My problem lies in that I have a background I want centred (vertically and horizontally) but the text needs to go slightly off-centre, meaning that I can't use absolute references and working out the precentage is going to be a nightmare! :eek:

I'm attaching a mock-up of how I want it to look, if it helps. The text I've used is from a guide I downloaded for Vice City, in case you're wondering.

I appreciate your time.
 

Attachments

Joined
Jul 26, 2003
Messages
2,431
hi Corrosive....

I'm not sure why you are having a problem with the text not wrapping to the next line
(I beleive that it's supposed to do that by default).
Maybe the <div> is not large enough to contain the contents :confused:

as to your other issue:
the text needs to go slightly off-centre
you can accomplish that by nesting a <div> that contains the text inside of the other <div> and use padding and/or margins to control it's absolute position within it.

try reading about that at this link (it's got lots of other good info):

W3 Schools

:) khaki
 

Corrosive

Thread Starter
Joined
Jan 9, 2003
Messages
1,058
Cheers to both of you! :D

khaki, I thought it was meant to as well, from what I made of the tutorial I saw, but it never worked. When I was experimenting though, I did find that adding "display: block;" to the <DIV> made it work.

I could understand how you'd need to add this with the <SPAN> tag, but isn't a <DIV> a block element anyway?

Weird. :confused:

Anyway, cheer's again. :D
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top