1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

CSS Positioning

Discussion in 'Software Development' started by Corrosive, Oct 20, 2003.

Thread Status:
Not open for further replies.
Advertisement
  1. Corrosive

    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.
     

    Attached Files:

  2. lora_3677

    lora_3677

    Joined:
    Aug 4, 2003
    Messages:
    1,228
  3. khaki

    khaki

    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:
    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
     
  4. Corrosive

    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
     
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 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/173323

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice