SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast ChrisXPPro's Avatar
    Join Date
    Apr 2010
    Location
    PA 15521
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Placing box of text like an image

    OK - here's the problem ..... a large old site I maintain is essentially html all thru - although I have over time applied quite a lot of css. However, the standard page ''container'' is a table cell used for content - no div container.

    It is easy on any page to float an image where needed within text but - this old guy's memory must be failing because I cannot right now thing of my best way forward to insert a box of text that will behave as if it were just a floated image.!

    I do not want to resort to absolute positioning as this is IMO unreliable from a cross browser POV. Should I use a dedicated div approach so as to contain a text box or even iframe? - end result required is having a box sit where I want, the same as if it was just an image, floated left or right with necessary margins. This is also very much a one of requirement and so the wish is to deal just with the page in question and inline styling.

    Senility is a real trial!! Help this old guy out - this seems to be a gap in my css memory.

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,762
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)
    I'm not sure if I understand you, if you want text next to an image do something like this?
    Code:
    <img><p>texttttt</p>
    The <img> floated and the <p> non floated (if you want the text ot wrap under the image that is )
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Mentor bronze trophy
    John_Betong's Avatar
    Join Date
    Aug 2005
    Location
    City of Angels
    Posts
    1,904
    Mentioned
    74 Post(s)
    Tagged
    7 Thread(s)
    I would be tempted to enclose the required text within a DIV and set a width using style. If the containing TABLE TD block has a specified width you can make your DIV width smaller and float your box.

    If the TABLE TD has no width then set your DIV to a percentage value.

    For debugging purposes set a border around your DIV.




    .
    Learn how to be ready for The New Move to Discourse

    How to make Make Money Now with a *NEW* look

    Be sure to congratulate Wolfshade on earning Member of the Month for August 2014

  4. #4
    SitePoint Enthusiast ChrisXPPro's Avatar
    Join Date
    Apr 2010
    Location
    PA 15521
    Posts
    41
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thx both - not sure I described the problem clearly enough tho I think John has got the drift. This is probably what I was thinking of and I will when time experiment again.

    The table is fixed width so does sound like a specified div width should work. I'll report back later and thx 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
  •