Recently i've posted a question on how could i possibly attach an image on top of my navibar menu. I did it thanks for help. Now i am facing with another issue. What if someone who is on my site presses Ctrl + ? And zoom in ? or zoom out? Then my picture is going to flow left or right. i want it to stay fixed position. like a pinned image. Or sth like that. I tried to put php code inside a div but it didn't work. So what can i do for it ?

For a start off: This really isn't a PHP related question since it has more to do with CSS. I don't know why you're using PHP, unless, you are generating or rendering the image.

Post some code, otherwise, we cannot help.

Phorce is correct, this has nothing to do with PHP and will most likely be moved to CSS soon. However, wrapping your image in div tags and setting the nowrap style could solve your problem:

<div style="white-space: nowrap;">
    <img ... />
</div>

I would of course create a CSS class rather than use inline styling but the code above is just a demonstration.

Michael

You're going to need to add the code, the whole navbar including the image you've added please (Not the actual image, just the code used to insert). Only then can I see where the CSS should be applied.

Member Avatar for LastMitch

What if someone who is on my site presses Ctrl + ? And zoom in ? or zoom out? Then my picture is going to flow left or right. i want it to stay fixed position. like a pinned image. Or sth like that.

@anestistsoukalis

Like what Phorce mention is correct. It's not really related to PHP at all.

I assume you are using @media queries in your CSS. That will resolve the issue you are having by setting the image position and size when you zoom in and zoom out any mobile/tablet device

Does that make sense?

@LastMitch - you keep mentioning mobile devices in CSS topics when none of the topics relate to mobile devices, can I ask why?

Member Avatar for LastMitch

you keep mentioning mobile devices in CSS topics when none of the topics relate to mobile devices, can I ask why?

Base on what OP said. What would be your answer? The first thing that would pop out from my mind would be a mobile device zooming in and zooming out.

OP said:

What if someone who is on my site presses Ctrl + ? And zoom in ? or zoom out?

OP is talking about zoom regardless of device or browser, he's trying to keep an image stuck in one location by the sound sof it (To the nav).

Member Avatar for LastMitch

OP is talking about zoom regardless of device or browser, he's trying to keep an image stuck in one location by the sound sof it (To the nav

But yes, that true, it's more technical issue than a code related. If OP wants a image being in one location but then it's CSS not PHP.

Don't worry, I flagged it hours ago for a category change xD OP: you need to look into positions on the image and the wrap of the image too.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.