Jump to content

DimTim

Member
  • Posts

    5
  • Joined

  • Last visited

DimTim's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Many thanks Benjamin, That has confirmed what I was kinda thinking, it also explains why I was unable to find a method despite many hours of searching. Special thanks for taking the trouble of posting your solution.
  2. Hi People, I'm sure this must have come up before but I can't find it despite much searching. I have a need to put positioned DIVs in a containing DIV and have the containing DIV increase it's size according to the content of the positioned DIVs. As expected, the containing div collapses and ignores the content of the inner DIVs, is there any way to force the container to expand as needed ? Here is the code to show what I am doing. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-- #header { width: 600px; background-color: #00FFCC; } #left { background-color: #339933; height: 201px; width: 141px; position: absolute; left: 57px; top: 10px; } #right { background-color: #FF0000; width: 200px; position: absolute; left: 302px; top: 7px; } #page-content { clear: both; background-color: #FFCC33; width: 600px; } --> </style> </head> <body> <div id="header"> <div id="left">left</div> <div id="right"> <p>right</p> <p>column </p> <p>variable content </p> </div> </div> <div id="page-content"> <p>This should be clear of the two DIVs in the header</p> <p> </p> <p> </p> <p>sd</p> <p> </p> <p>sdf</p> <p>v</p> </div> </body> </html> Any help much appreciated.
  3. Unbelievable, Even though you were quite explicit when you corrected me, I still couldn't see that wayward "img". Is it any surprise that I spent a whole day playing with this? Guess I'm living up to my name "DimTim". I will now crawl away and sit quietly in my corner. Thanks again for your help.
  4. Thanks for that Benjamin. You have confirmed that I was doing the right thing. Now becoming very confused with the whole issue though. I tried the code as you posted (which was very similar to that which I tried) but still the image which should be centered is floated right. I have also tried to float left. Obviously I am missing something but I simply cant find out what it might be. Could I trouble you some more to take a look at the code below and see if you can see any reason why it is not working. Many thanks again. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <title>Untitled Document</title> <style type="text/css"> <!-- #content { width: 800px; } #content img { float: right; } #content .piccenter img {float: none;} --> </style> </head> <body> <div id="content"> <p><img src="photo1.jpg" width="250" height="166">text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p><img src="photo2.jpg" width="250" height="166" class="piccenter"></p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> <p>text</p> </div> </body> </html>
  5. Hi all, I have been working on a "sort of" content management system. I don't want to use a proprietary CMS because I want only very limited functionality for absolute dummy's to use so it has to be simple in the extreme. It's a long story. I am trying to achieve positioning images using CSS but can't get it right. I have a div for the main content and want any images aligned right so text flows around it as would be achieved like this : <img src="photo.jpg" align="right"> I set up CSS like this : That works perfectly as I intended, all images are placed correctly. However, I also want to be able to specify an image to be placed horizontally centred on a new line like this would achieve Now the problem, even though that centred image is told to centre, it is right aligned and text flowed as the other images. Is there a way to simply say "look, ignore the "float: right;" you have previously been told do this instead? Appreciate any help that can be offered.
×
×
  • Create New...