Recent Topics

1 Nov 05, 2010 06:52    

My b2evolution Version: 3.3.3

Can anyone tell me if there is a way to set a border color for images in the css so when I turn on a border for an image I don't have to manually set the border color each time? I'm working with the Underground skin if that matters.

2 Nov 05, 2010 13:52

img {
border-color: red;
}

3 Nov 07, 2010 04:19

I tried inserting this:

img { 
border-color:#cbac26; 
}

but I still get a black border. Does it have to go somewhere specific? I just dropped it on the line below

a img {border:0px; vertical-align:middle;}

(my line 107).

The result can be seen here: http://66.114.45.2/~kcltorg/index.php/BuyingaHome/

4 Nov 07, 2010 04:34

Use this code instead, otherwise all images in you site will get a border (icons, logo, header etc).

.post img { border: #cbac26 1px solid }

Black image border is hard-coded in the post.

<img style="float: left; border: 1px solid black; margin: 5px;" src="/%7Ekcltorg/media/blogs/BuyingaHome/home1.jpg" alt="" height="150" width="220" />

5 Nov 07, 2010 05:12

Ok, I think what you've pointed out is that what I'm trying to do won't work. I was trying to make it so when I create a post, insert a picture, then right click on the picture and choose "Insert/Edit Image" and put a border on it, say 1, the border is whatever color I've specified in the css file. This way, I wouldn't have to have my client edit html to change the border color every time they put a new image in. But as you've pointed out, when this is done using the WYSIWYG editor, the code is automatically generated using specifically a black border. I'm assuming there's no way around this...?

!!!UPDATE!!!

Ok, I tried your suggestion and it seems like a great workaround. It automatically generates a 1px border of the color I've forced in the css. Then, to override, I can go ahead and mess with the WYSIWYG controls if necessary. Great solution...as usual!

6 Nov 07, 2010 05:53

If you want to force border color, just add the "!important" flag.

.post img { border-color: #cbac26 !important; }


The color will always be orange regardless of what you have hard-coded in a post.

<img style="border: 1px solid black" ... />


The border will still be orange


Form is loading...