Hello Lovely People
I've looked at previous posts, but I'm struggling with image margins inside the {content} section.
If I embed a style with 'margin: 10' inside the img tag on the page it works, but I'd rather use stylesheets.
I'm using the supplied 'Left simple navigation + 1 column' template and 'Layout: Left sidebar + 1 column' css while I learn about all this brilliant CMS system.
Earlier posts suggested changing the 'img' tag in css to achieve a margin. I've tried this and it has no effect for me.
What am I doing wrong?
Thanks in advance!!!
Keith
Image margins - is it me? <Solved>
-
keithbrook
Image margins - is it me? <Solved>
Last edited by keithbrook on Fri Jan 26, 2007 9:40 pm, edited 1 time in total.
-
heatherfeuer
Re: Image margins - is it me?
Hi! I had the same problem. I hate it when the text bumps up right against an embedded image. What worked for me was to add an extra style to the 'img' tag in the main stylesheet. The style for img looks like this:
You can experiment with the margin, but .5em worked well for me.
Code: Select all
img {
border: none; /* Prevents images inside an "a" tag from showing a border */
margin: .5em; /* Puts some air between images and surrounding text */
}
-
keithbrook
Re: Image margins - is it me?
Thanks for that Heather.
Strangely, margins: 20 and margins: 20px didn't work for me but .5em does.
You've saved me a load of coding.
By the way, your logo reminds me of a previous girlfriend from Texas. Did I say that? Yes I did!!!
Many thanks again.
Keith
Strangely, margins: 20 and margins: 20px didn't work for me but .5em does.
You've saved me a load of coding.
By the way, your logo reminds me of a previous girlfriend from Texas. Did I say that? Yes I did!!!
Many thanks again.
Keith
Re: Image margins - is it me?
"Strangely, margins: 20 and margins: 20px didn't work for me but .5em does. "
margins: 20 or 20px will not work because CSS only understands margin: no s...
You can also target specific images using the div id/class...
#main img {margin: 20px}, margin/padding work clockwise margin: 5px top 5px right 5px bottom 5px left...
Leaving one of them out will give various results, leave one out and you get top, right/left, bottom,,, 2 out, top/bottom, left/right,,, 3 out, top/bottom/left/right...
margins: 20 or 20px will not work because CSS only understands margin: no s...
You can also target specific images using the div id/class...
#main img {margin: 20px}, margin/padding work clockwise margin: 5px top 5px right 5px bottom 5px left...
Leaving one of them out will give various results, leave one out and you get top, right/left, bottom,,, 2 out, top/bottom, left/right,,, 3 out, top/bottom/left/right...
-
keithbrook
Re: Image margins - is it me?
Thanks for that, Mark.
It was a typo on my part in the previous post.
However, it's working with 'margin' now, so maybe I did mistype it.
Perhaps the combination of old age and copious amounts of red wine!!!
Thanks for the '#main img {margin: 20px}' tip as well.
This is a great forum and a great CMS as well.
Now, how do I make a real estate CMS...........ah, there's something on the forum!!!!
Thanks again.
It was a typo on my part in the previous post.
However, it's working with 'margin' now, so maybe I did mistype it.
Perhaps the combination of old age and copious amounts of red wine!!!
Thanks for the '#main img {margin: 20px}' tip as well.
This is a great forum and a great CMS as well.
Now, how do I make a real estate CMS...........ah, there's something on the forum!!!!
Thanks again.
Last edited by keithbrook on Fri Jan 26, 2007 11:53 am, edited 1 time in total.

