Can you replace an Image with Text on small screens

Everything to do with Joomla! 3.x templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
User avatar
Bikerdave
Joomla! Explorer
Joomla! Explorer
Posts: 267
Joined: Tue Jul 17, 2007 12:43 pm
Location: South West England Near Exeter

Can you replace an Image with Text on small screens

Post by Bikerdave » Sat Dec 01, 2018 5:20 pm

Hi

I have an interesting problem.

My client wants images with text and I have created png images which include the text. This is ok except on small screens when the text is too small to read.

I cant seen to find any ideas of how to replace an image with text at small screen sizes or is there a better way?

Any help would be appreciated.

Thanks

David
http://www.moorweb.co.uk

Rules Stifle Creativity

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Can you replace an Image with Text on small screens

Post by Webdongle » Sat Dec 01, 2018 5:48 pm

Use modules for images that have text and for text only. You can set the modules to display only on computers or just mobiles etc. Module class suffix
hidden-phone or hidden-desktop or logo-top-tablet or any combination. Don't forget a leading space.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
HZolfaghar
Joomla! Intern
Joomla! Intern
Posts: 78
Joined: Sun Jan 03, 2016 7:10 am
Location: Iran

Re: Can you replace an Image with Text on small screens

Post by HZolfaghar » Sun Dec 02, 2018 8:17 am

Bikerdave wrote:
Sat Dec 01, 2018 5:20 pm
Hi

I have an interesting problem.

My client wants images with text and I have created png images which include the text. This is ok except on small screens when the text is too small to read.

I cant seen to find any ideas of how to replace an image with text at small screen sizes or is there a better way?

Any help would be appreciated.

Thanks

David
HI Bikerdave

Your customer's request is not logical.
1- You can change the size of the text on different screen sizes through Css and in any size of the screen, choose the right size for your text. This can be done with CSS.
2- But your own solution, the replacement of the text with the image, can also be done through the CSS. But this is not the right way for your problem.

Choose one of the two to give you the solution.

Hzolfaghar ;)

User avatar
JTema
Joomla! Guru
Joomla! Guru
Posts: 733
Joined: Sun Apr 13, 2008 8:10 pm

Re: Can you replace an Image with Text on small screens

Post by JTema » Sun Dec 02, 2018 11:43 am

Bikerdave wrote:
Sat Dec 01, 2018 5:20 pm
Hi

I have an interesting problem.

My client wants images with text and I have created png images which include the text. This is ok except on small screens when the text is too small to read.

I cant seen to find any ideas of how to replace an image with text at small screen sizes or is there a better way?

Any help would be appreciated.

Thanks

David
An other suggestion:
create 2 different content for example content for mobile and content for desktop content for mobile may be under desktop content. Create 2 different divs for each. Eg. for The Desktop content it may be hidden-phone div. The mobile content can be just text without images. Then go to css and use media queries to show and hide each content for mobile and desktops.I assume that you know media queries.
this is an example

Code: Select all

@media (max-width: 480px) {
div.hidden-phone{display:none;	}
}
@media (max-width: 768px) {
	div.hidden-phone{display:none;	}
}
http://www.joomlatema.net - Joomla Extensions and Templates
https://asgardia.joomlatema.net - Asgardia Joomla Gardening Template

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44071
Joined: Sat Apr 05, 2008 9:58 pm

Re: Can you replace an Image with Text on small screens

Post by Webdongle » Sun Dec 02, 2018 12:45 pm

muratyil wrote:
Sun Dec 02, 2018 11:43 am
.
An other suggestion:
create 2 different content for example content for mobile and content for desktop content for mobile may be under desktop content. Create 2 different divs for each. Eg. for The Desktop content it may be hidden-phone div. The mobile content can be just text without images. Then go to css and use media queries to show and hide each content for mobile and desktops.I assume that you know media queries.
this is an example

Code: Select all

@media (max-width: 480px) {
div.hidden-phone{display:none;	}
}
@media (max-width: 768px) {
	div.hidden-phone{display:none;	}
}
That is not another option that is the option previously presented. But you have made two mistakes
First you don't need two divs (or module positions)
You don't need to add the css because hidden-phone etc. is in bootstrap and already in Joomla.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “Templates for Joomla! 3.x”