-
AuthorPosts
-
March 2, 2018 at 9:31 pm #920553
I have an image in the background of my menu area on a site that I’m working on. The way it is designed it causes issues on larger screens because it sticks to the left side of the screen. See attached images.
https://ibb.co/d973v7
https://ibb.co/egkCoSCan someone help me with how I can make it so that the background image will stick or ‘Float’ to the right of the screen instead using css? I can’t seem to find the right selector.
- This topic was modified 6 years, 9 months ago by hotspot01.
March 3, 2018 at 8:17 am #920671Hey Chris,
Could you post a link to the site in question so that we can take a closer look please?
Best regards,
RikardMarch 16, 2018 at 11:52 pm #928337I figured out the float solution. It doesn’t work the way I was hoping it would. I’ve brainstormed another solution and I’m not sure if this should be a new topic or not.
I’ve made the background a solid colour and I’ve created a background ‘panel’ image that is a transparent png to go behind the logo. I’ve added the panel to the background of the logo using the following CSS:
.logo a { overflow: visible; display: block; height: 100%; float: left; left: 0; z-index: 1; background: url(https://hotspotcreative.ca/testsites/apexsolar/site/wp-content/uploads/2018/03/apex-logo-bg-panel-01.png); background-repeat: no-repeat; width: 464px; background-position: -120px 0px; }
I have the panel shifted to the left so that I get a nice clean white edge on smaller screens but on larger screens it should show the whole panel.
The problem I’m having is that the entire panel is not showing because of the container. I’ve tried setting the overflow to visible but it doesn’t seem to have any effect. Does anyone have a suggestion on how I get the whole image to show?
March 19, 2018 at 5:31 pm #929169Hi,
Have you tried to use the background position in % instead of px or you can even try 10vw which is 10% of the viewport width so it maintains a constant distance.
Best regards,
VinayMarch 21, 2018 at 5:34 am #930288The problem with doing it that way (at least when I tried it) is that it will always be inside the container. I actually want it to hang outside of the container on the left. Here is a sample of what I am going for:
[img]https://thumb.ibb.co/j0U8Pc/apex_nav_sample.jpg[/img]
https://ibb.co/j0U8PcI just need to figure out how to make the overflow display the part of the the panel that is currently hidden. Is it something that is possible?
- This reply was modified 6 years, 9 months ago by hotspot01.
March 22, 2018 at 6:46 am #931057Hi,
Please try to apply the panel background in the .logo container instead of the logo link then push the logo link towards the right.
div .logo { width: 100%; overflow: visible; display: block; height: 100%; float: left; left: 0; z-index: 1; background: url(//hotspotcreative.ca/testsites/apexsolar/site/wp-content/uploads/2018/03/apex-logo-bg-panel-01.png); background-repeat: no-repeat; left: -121px; } div .logo a { margin-left: 121px; }
Best regards,
IsmaelMarch 23, 2018 at 12:00 am #931709That worked wonderfully!! Thank you so much.
Ok. I have one last question. Is it possible to only get the bg panel to show when the page is scrolled similar to the way the coloured logo shows up? or does the ‘transparency logo’ just cover the regular logo?March 24, 2018 at 5:12 pm #932389Hi,
We are afraid that is not possible. At least not easy with some extra JS.
You would need to hire someone who would be able to help you out with it.Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.