- This topic is empty.
-
AuthorPosts
-
May 17, 2014 at 6:23 am #170453
karimphoto
ParticipantHi,
I having problem with the placement of the background image generated with background manager. Here is how my page looks now and this is how I would like it to look.
Anyone have any input for me?
Thanks
May 17, 2014 at 6:34 am #170457Paulie_D
MemberThe second link isn’t a background image at all as far as I can tell but clearly this is a WP issue.
I’ll move it over there since it involves a plug-in.
May 17, 2014 at 6:51 am #170460karimphoto
ParticipantThank you Paulie_D and sorry for that.
I’m using the theme Touchfolio and use a plain wordpress page as a static “landing” page. Through that page I have inserted the image Set generated by background manager for WordPress.
Hope this is clear enough
May 17, 2014 at 2:01 pm #170483chrisburton
ParticipantIt looks the same to me besides the dimensions.
@Paulie_D This appears to be a CSS issue not PHP.May 18, 2014 at 2:25 am #170521karimphoto
Participant@chrisburton thanks.
Basically I would like to be able to adjust the placement of the image. I’m using Firebug and Chrome Developer Tools but don’t find where to do the changes or place the code…
The custom stylesheet in background manager is not doing anything for me.
In the end I’m looking for a solution with a background image viewer that changes on on page (re)load and resize to different screen sizes and mobil devices…
Thanks
May 18, 2014 at 5:17 am #170524Paulie_D
MemberSeems to be related use of a WP plug-in which is why I thought it would be more relevant in the PHP/CMS section but Im happy to move it back.
May 18, 2014 at 9:02 am #170531karimphoto
ParticipantI got some help and now it look better.
body.myatu_bgm_body {
background-attachment: fixed !important;
background-color: #FFFFFF !important;
background-position: 81% center !important;
background-repeat: no-repeat !important;
background-size: auto 85%;
}And I put it in the custom stylesheet.
Another thing I’m thinking about is that the image is sliding under the left sidebar if I make the screen size smaller. Any idea how can work on this?
May 18, 2014 at 9:22 am #170532Atelierbram
Participant13em
is thewidth
of the sidebar, so when it’sbackground-position: 13em center;
, the image lines up with that left sidebar. At850px
when the menu becomes “hamburger dropdown in top right corner”, you could change that in amediaquery
tobackground-position: 0 0 ;
or something;@media (max-width:850px) { body.myatu_bgm_body { background-position: 0 0; background-size: 100% 100%; } }
May 18, 2014 at 10:55 am #170533karimphoto
ParticipantThank you @Atelierbram.
Sorry but I really don’t understand what this would do?
Maybe it’s not a issue with the left sidebar and I can leave it as it is…
May 18, 2014 at 11:18 am #170534Atelierbram
ParticipantSorry but I really don’t understand what this would do?
It will fix the image sliding under the left sidebar if the screen size gets smaller .
Maybe it’s not a issue with the left sidebar
It has to do with those two (the sidebar and the background-image) getting in each others space when the viewport gets smaller, and the fact that the background-image has a horizontal
background-position
declared in a percentage (relative to the viewport/browser-window) that will shift that position when the viewport size changes.and I can leave it as it is…
But why not try?
BTW: do you understand what media-queries are, or do?
May 18, 2014 at 11:42 am #170543karimphoto
ParticipantYou are right I should give it a try. I’m newbie to this so I would be very happy if you would like to guide me.
Should I replace my code with yours or add it?
If I add “background-size: 100% 100%;” will the image not cover the whole screen then?
My previous code I put in the custom stylesheet for my background image set, is the where I should put your code?
Sorry for my poor skills and thanks for your time.
May 18, 2014 at 12:08 pm #170546Atelierbram
ParticipantShould I replace my code with yours or add it?
You can just add it to your custom stylesheet, (mind the
!important
), or/✳
out-comment✳/
the property-value pairs you are overwriting.If I add “background-size: 100% 100%;” will the image not cover the whole screen then?
If that is not what you want on small-screen, then why not change it to something else …
May 18, 2014 at 2:31 pm #170550karimphoto
ParticipantGreat. It almost work super. It looks great on Iphone 4 but not so good on other phones like Iphone 5 and Samsung Galaxy models…
The code I’m using now is:
body.myatu_bgm_body {
background-color: #FFFFFF !important;
background-position: 81% center !important;
background-repeat: no-repeat !important;
background-size: auto 85%;
}
@media (max-width:850px) {
body.myatu_bgm_body {
background-position: 0 0;
background-size: contain;
}May 19, 2014 at 12:40 am #170576Atelierbram
Participant@karimphoto
Last closing curly brace}
of media-query is missing (CSS
declarations are nested within those{}
); should be:@media (max-width:850px) { body.myatu_bgm_body { background-position: 0 0; background-size: contain; } }
Browsers can trip over something like this: could explain inconsistencies …
May 19, 2014 at 1:39 am #170582karimphoto
Participant@Atelierbram Thanks.
On Iphone 4 it looks good
On Iphone 5 it looks good in portrait mode but in horizontal mode it adjust the image to the right…
On Samsung Galaxy,,, it looks bad in both portrait and horizontal mode, the image will not center or adapt to screen size.I did add the last closing curly brace. Anything else I missed here?
Thanks
body.myatu_bgm_body {
background-color: #FFFFFF !important;
background-position: 81% center !important;
background-repeat: no-repeat !important;
background-size: auto 85%;
}
@media (max-width:850px) {
body.myatu_bgm_body {
background-position: 0 0;
background-size: contain;
}
} -
AuthorPosts
- The forum ‘CSS’ is closed to new topics and replies.