monique
10-25-2007, 09:01 AM
On the website for Wish Foundation Shamajo I regularly use tables to make up the text on pages when they contain images too. I know there are a lot of discussions on the internet going on about using tables for making up pages or not, but because of better accessibility I am now trying to make up those pages using CSS only.
But of course it should look nice too. ;)
I created a test page where you can see both (1) using tables and (2) CSS only: http://www.shamajo.nl/hometest.htm.
As you can see, part (1) using the tables lines out text and images very well. The images are being lined out left and the text that belongs to the images is properly written next to the image. Further the arrow up ("naar boven") is lined out properly on the left and the headers (h2) properly in the center.
Now when you look at part (2) made up in CSS only, you can see that when the text is only very short, both the arrow up and the header are not anymore lined out properly left resp. center. They seem to line out taking into consideration the image size and than line out left resp. center. :(
This is the CSS-code I have used here:
p.imageleft img {float:left; margin: 0 1em 1em 0;}
I have tried various ways to solve this problem, but can't find any solution that works properly. :o
The only thing that did help is using extra <br /> at the end of the text to push the text down, but I believe it is not the correct way to do and further it is very complex too, because I'd have to check for every <p> if the text is long enough or not and how many times <br /> I'd have to add. :eek:
Does someone know how I can solve my problem?
Thanks a lot!
Monique
But of course it should look nice too. ;)
I created a test page where you can see both (1) using tables and (2) CSS only: http://www.shamajo.nl/hometest.htm.
As you can see, part (1) using the tables lines out text and images very well. The images are being lined out left and the text that belongs to the images is properly written next to the image. Further the arrow up ("naar boven") is lined out properly on the left and the headers (h2) properly in the center.
Now when you look at part (2) made up in CSS only, you can see that when the text is only very short, both the arrow up and the header are not anymore lined out properly left resp. center. They seem to line out taking into consideration the image size and than line out left resp. center. :(
This is the CSS-code I have used here:
p.imageleft img {float:left; margin: 0 1em 1em 0;}
I have tried various ways to solve this problem, but can't find any solution that works properly. :o
The only thing that did help is using extra <br /> at the end of the text to push the text down, but I believe it is not the correct way to do and further it is very complex too, because I'd have to check for every <p> if the text is long enough or not and how many times <br /> I'd have to add. :eek:
Does someone know how I can solve my problem?
Thanks a lot!
Monique