Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2013-04-19 08:39:43
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
How to remove size from IMG tag
the IMG tag bring automaticaly height and width with any images : <img src=“x” width=“x” height=“x” />
I want just image tag without width and height: <img src=“x” />
Offline
Re: How to remove size from IMG tag
If you mean from the txp:image tag then you can use attributes width="0" height="0"
to turn them off.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
#3 2013-04-19 09:09:31
- raminrahimi
- Member
- From: India
- Registered: 2013-03-19
- Posts: 278
Re: How to remove size from IMG tag
Yes that’s work fine, thank you
But Also i have installed and using the plugin: wet_article_thumb
i did width=“0” height=“0” , that’s not working !
Offline
Re: How to remove size from IMG tag
I don’t think wet_article_thumb honours the width and height attributes as it pre-dates their inclusion in the core tags txp:image / txp:thumbnail. I may be wrong, but that’s probably the issue.
Last edited by Bloke (2013-04-19 09:41:33)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: How to remove size from IMG tag
Regardless of the plugin ways or the native ways to display images, maybe using class attributes would be a good choice.
CSS classes like these for instance:
img.small {width: x;}
img.medium {width: x;}
img.large {width: x;}
txtstrap (Textpattern + Twitter Bootstrap + etc…)
Offline
Re: How to remove size from IMG tag
The best practice is always use width and height with the img tag. It helps the browser out, and your visitor. The image will not cause any content shifting while its loaded, for one.
If you want to remove the proportion attributes to have ‘responsive’ images that scale, you can use CSS and override the attributes. The attributes are there for browsers and not for presentation. Basically setting width and height to auto nullifies the attributes’ affect.
Offline
Pages: 1