Support Forums

Support Offline : Mon - Fri / 10am - 6pm (GMT +6)

Your Time: Our Time:

Add Height and Width Attribute To Images

Featured Lock Resolved Issue
How can I add the height and width attribute to images? I saw a previous question asked, but the support person only said it can be done in CSS. I truly don't know how to do this, so any help would be greatly appreciated.

I tried to add what I thought was the correct CSS in the Custom CSS area under the Style tab, but it appeared to have no affect. Thank you in advance!

6 Answers

Sifat - Staff

More than a month ago #Permalink
Hi,
Thanks for your query. Yes you can add css to change the height and width of any images.
You can check this screencast https://files.fm/u/44z46mvr
I think you are adding css in wrong place. Here is the custom css field https://www.joomshaper.com/documentation/helix-framework/helixultimate#documentation-heading-1_8


-Best Regards

Mike

More than a month ago #Permalink
Hi Sifat,

Thank you so much for taking the time to walk me through that. It was very helpful, but do have a question...

Is there a way to add some type of command or code that adds the height and width based off of the dimensions of the uploaded picture, or from the name of the photo?

For example, if I load up a 275 x 275 picture, the dimensions would automatically be added to the attribute?

If not, does that mean for every photo I upload which might have a different dimension, I could use different custom names, like custom-pic1, then specify it in the custom css. file?

Again, thank you for helping me learn,
Mike

Mike

More than a month ago #Permalink
Also, I did this on my test site at staging.cloudaccess.host, and modified the bottom left company logo. I have also taken a screenshot and it appears it is not adding the attribute like your example shows when viewing the elements.

Attachments (1)

  • 2019-05-21_06-28-05.png
    2019-05-21_06-28-05.png 590.3 KB

Sifat - Staff

More than a month ago #Permalink
Hi,
Thanks for your reply. Sorry there is no default feature to resize images automatically. You can resize your images before uploading them. if I load up a 275 x 275 picture then it'll remain 275X275. But it'll be automatically shrink for the smaller devices. And i think you've missed the semicolon in the code. Here is code what i've used there.

.custom_image img {
height: 500px;
width: 500px;
}

Please let me know if it works.

Mike

More than a month ago #Permalink
That worked!

Thank you!

Sifat - Staff

More than a month ago #Permalink
You are always welcome.


There are no replies made for this post yet.
Be one of the first to reply to this post!

Leaderboard (30 days)

Sifat

Sifat

Total Accepted Answers: 119
Paul Frankowski

Paul Frankowski

Total Accepted Answers: 110
Toufiq

Toufiq

Total Accepted Answers: 89
Kamruzzaman Alam

Kamruzzaman Alam

Total Accepted Answers: 4
FUTURECLIENT

FUTURECLIENT

Total Accepted Answers: 2

115

Templates

296174

Community Users

Newsletter

Don’t miss any updates of our new templates and extensions and all the astonishing offers we bring for you.
We never spam

Joomla! ® name is used under a limited license from Open Source Matters in the United States and other countries. JoomShaper.com is not affiliated with or endorsed by Open Source Matters or the Joomla! Project.

Connect Us