Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-09-03 21:29:33

osugodfan
Member
Registered: 2008-03-16
Posts: 16

[textile] Can't get width/height attributes to NOT show up.

Hey guys, I’m using this code inside an article for an image:

h2(title). !i/title_gallery.png(Displays and Gallery)!

Interestingly enough, the source still displays the width and height, even though I’m not defining it, here. Any ideas why? Something in admin, maybe?

Offline

#2 2008-09-04 04:13:09

jm
Plugin Author
From: Missoula, MT
Registered: 2005-11-27
Posts: 1,746
Website

Re: [textile] Can't get width/height attributes to NOT show up.

In what situation would you not want the width and height attrs?

Offline

#3 2008-09-04 07:32:08

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: [textile] Can't get width/height attributes to NOT show up.

jm wrote:

In what situation would you not want the width and height attrs?

Having width & height appear as HTML attributes can be a pain if you’re designing a flexible layout that expands with the font size & you want to resize the image in CSS.

To get around images being stretched, I’ve found that setting either the width/height to a percentage & the other to ‘auto’ in CSS works well, e.g.:

img {
width:50%;
height:auto;
}

Or if it still doesn’t work (some versions of IE can be troublesome in this respect), then you can use upm_image with attributes show_width="0" & show_height="0" to get the image on the page without the HTML width/height attributes.

Offline

#4 2008-09-04 16:57:09

osugodfan
Member
Registered: 2008-03-16
Posts: 16

Re: [textile] Can't get width/height attributes to NOT show up.

Thanks for the info. I’ll give it a shot and let you know.

Offline

Board footer

Powered by FluxBB