Advertisement

Picture at home page does not fit

Everything to do with Joomla! 5.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.
Post Reply
liekecomp2022
Joomla! Intern
Joomla! Intern
Posts: 85
Joined: Mon Aug 29, 2022 10:37 am

Picture at home page does not fit

Post by liekecomp2022 » Mon Jan 20, 2025 11:15 am

The big picture at the home page of the website https://ontwikkel12.comp-it-aut.nl/ does not fit at tablet, mobile etc.
It should look the same like at the website https://www.inzichtencoaching.nl/.
Can someone help me with the correct adjustments or give me the css code?

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

Re: Picture at home page does not fit

Post by Webdongle » Mon Jan 20, 2025 11:26 am

Fits on my Samsung A53 5g
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
AMurray
Joomla! Master
Joomla! Master
Posts: 10486
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Picture at home page does not fit

Post by AMurray » Mon Jan 20, 2025 9:08 pm

Just by testing (resizing browser window on a desktop PC), I can see the first one doesn't resize like the second example.

Do you need to make the picture dimensions "%" not "px"? With % it should adjust to the device/screen size, or you need to use @media directives for defining the dimensions for approximate sizes of different devices.

References: https://www.w3schools.com/cssref/atrule_media.php and https://www.w3schools.com/css/css3_mediaqueries.asp
Regards - A Murray
Global Support Moderator

User avatar
ceford
Joomla! Hero
Joomla! Hero
Posts: 2978
Joined: Mon Feb 24, 2014 10:38 pm
Location: Edinburgh, Scotland
Contact:

Re: Picture at home page does not fit

Post by ceford » Tue Jan 21, 2025 5:19 am

Look at the page source in your browser Developer Tools. It contains strange looking style statements suggesting the problem lies with your template.

Mr. Wimpy
Joomla! Guru
Joomla! Guru
Posts: 607
Joined: Fri Dec 02, 2005 10:46 am
Location: The Netherlands

Re: Picture at home page does not fit

Post by Mr. Wimpy » Tue Jan 21, 2025 4:11 pm

Short answer

To get the face to show similar as the demo, on small and big screens, change

Code: Select all

.sp-page-builder .page-content #section-id-1736860062416 {
  (...)
  background-position: 0 0;
}
to

Code: Select all

.sp-page-builder .page-content #section-id-1736860062416 {
  (...)
  background-position: center;
}
Long answer

Your html and css is too complicated for something this simple.
That makes it difficult for us to help you or for yourself to fix and maintain.

I don't know SP Page Builder, so the output may be created by SPPB or because you designed it this way in SPPB.
But see if you can clean it up first.

Clean code == easy to maintain / trouble shoot

I believe what you want, can be achieved with html that is 3-4 levels deep.
(Yours is 10: <div> inside <div> inside <div> inside <div>, etc.)

If SPPB allows it, add your own classes and use those in your css.
The id-numbers added by SPPB makes it difficult to read your code.

Advertisement

Post Reply

Return to “Templates for Joomla! 5.x”