Fog Creek Software
Discussion Board




Knowledge Base
Documentation
Terry's Tips
Darren's Tips

alteration of img tag

Hi there,

My citydesk sites are quite heavy on CSS, and one of the things i do for standard is to set the margins for all images on the whole website in my stylesheet.

However, whenever my customers, using the contributors edition, add an image to an article (and of course, they do *not* use the HTML view, because they do not *want* to see HTML code) citydesk adds a margin-left or margin-right style to the image, overriding my margin settings.

Is there a way to get rid of those nasty img margin defaults?

Thanks

Ewout de Graaf
Monday, May 24, 2004

I think there is a way in CSS to override settings using an important! attribute or something.

David Burch
Monday, May 24, 2004

I don't think css will overide the html attributes.  However, you can run tidy as part of the post build publishing process, and strip that stuff out. 

joel goldstick
Tuesday, May 25, 2004

Tried to find it on the web, but i cannot find any css code that will override the "style=" that Citydesk adds to an img by default.

Running HTML tidy is an option, but how do i explain that to my customers. Good for me, but they want to use plain citydesk and not be bothered with extra steps...

Ewout de Graaf
Wednesday, May 26, 2004


Citydesk allows you to automatically run a program after it does what it does and before it does ftp.  If you wrote the script, and set up citydesk, they wouldn't have to know

Joel Goldstick
Wednesday, May 26, 2004

Which reminds me. This would be much more useful if you could add the step to "preview on this computer".  Otherwise you have to tell users to ignore that big 'ol "Preview" button and use separate preview location set up to run your "before copy" command.

Ken McKinney
Wednesday, May 26, 2004

Tap into CSS's specificity, probably the most overlooked element of CSS.

Write your rules for images in a certain location (let's say #maincontent) from the body tag, as in

body #maincontent p img

which gives it a huge specificity...

I am no CityDesk expert, so I cannot say how it modifies image tags to create float alignment one way or the other - -- but I know that in most cases, a higher specificity will override any other rule values regardless of where the rule is written in the cascade.

Hope that gives you ideas for overcoming the problem...

DC
Sunday, November 21, 2004

*  Recent Topics

*  Fog Creek Home