Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2014-06-01 04:42:55
- fiddle
- Member
- Registered: 2007-10-03
- Posts: 87
Article Img size width/height.... cant explain...
Hi all,
This might be a simple question..
Im trying to do a responsive layout, so I give my images a width of 100%, but noticed txp automatically assigns the image width/height, so 100% is out the window…
Any way around this.?
Thanks
Offline
Re: Article Img size width/height.... cant explain...
I think that the issue came up before and txp core code is now changed in the development version. There are two ways.
1. use <txp:image_info />
Something like
<img src="images/<txp:image_info id="xx"/>/<txp:image_info type="ext"/>" width="100%" alt="<txp:image_info type="alt"/>"/>
2. adapt the code above to create a macro using smd_macro.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Article Img size width/height.... cant explain...
Setting the height and width to “0” in the image tag turns off the production of these attributes altogether.
So use <txp:image id='xx' height="0" width="0" class="my_img_class"/>
and in your css include:
my_img_class img {width:"100%";}
or even better perhaps
<txp:image id='xx' height="0" width="0" />
and use an appropriate more abstracted selector in your css to target the image and assign it the 100% width.
Last edited by joebaich (2014-06-03 02:36:51)
Offline