PDA

View Full Version : Indenting text with image using CSS


yashombi
08-01-2006, 08:32 AM
Hi, I am trying to indent my text within some table columns using CSS.
I have managed to indent my paragraphs as explained on many sites:p {text-indent: 1.5em;}

But what I want to do is indent the entire text (not just paragraphs) and place an image at the top of each of my category choices within my table columns. View link below to see exactly what I mean:

http://antiques.ebay.co.uk/

If anyone could direct me towards how I can acheive this it would be much appreciated.

domedia
08-01-2006, 12:49 PM
Something like this?
<td style="padding-left: 20px;"><img>

text</p></td>

yashombi
08-01-2006, 04:47 PM
I was thinking more along the lines of creating a stylesheet to handle the alignment and layout of the columns and head link (in bold). I noticed through the source code the ebay example has done just that generating the structure of the links using CSS, so I know it can be done and its piqued my interest. I would then be able to change and up date the links quickly without having to restruture tables and designs.

Making a small box in CSS or adding a small gif, then aligning it with each header link so I just need attach a style and it ads the sqaure and padding all in one. Then just add the style where required.

domedia
08-01-2006, 07:20 PM
Add a class on the TD and put the same CSS code in the stylesheet :)

yashombi
08-03-2006, 06:49 PM
I've done as you said but have a slight problem, a rouge arrow icon. When trying to add an image using CSS i've not found another way of placing an image other than using the background command, current CCS used

.table-display
{background: url(../images/home/arrowmenu.gif) no-repeat top left;padding-left: 15px;}

Slowly getting to grips with CSS, got to start somewhere. Thanks for the help so far.

domedia
08-03-2006, 07:03 PM
Hi yashombi, the baove CSS code is valid. Let me know if it outputs in a different way thann you need.

yashombi
08-03-2006, 07:17 PM
Thanks got it working, had my classes wrong.